| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7339,7 +7339,7 @@ static public void runSketch(String args[], final PApplet constructedApplet) { | |||
| 7339 | 7339 | ||
| 7340 | 7340 | // remove the grow box by default | |
| 7341 | 7341 | // users who want it back can call frame.setResizable(true) | |
| 7342 | - //frame.setResizable(false); | ||
| 7342 | + // frame.setResizable(false); | ||
| 7343 | 7343 | // moved later (issue #467) | |
| 7344 | 7344 | ||
| 7345 | 7345 | // Set the trimmings around the image | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -10,26 +10,28 @@ X need to finish font changes wrt native fonts before any release | |||
| 10 | 10 | X right now not in a good place--default font will be bitmapped and ugly | |
| 11 | 11 | X http://code.google.com/p/processing/issues/detail?id=416 | |
| 12 | 12 | o need to have some kind of subsetting mode, but 'subsetting' a bad name | |
| 13 | + X changing PDF to use textMode(SHAPE) by default | ||
| 14 | + _ need to update the reference for textMode(MODEL) | ||
| 15 | + | ||
| 16 | + _ saving a PGraphics as jpg using save() makes a cmyk file | ||
| 17 | + _ need to shut off the alpha channel when writing | ||
| 18 | + _ http://code.google.com/p/processing/issues/detail?id=415 | ||
| 19 | + | ||
| 20 | + _ present mode is no longer centering on osx? | ||
| 21 | + _ bug: textAlign(RIGHT) is shutting off native fonts | ||
| 22 | + _ makes salaryper super ugly | ||
| 13 | 23 | ||
| 14 | 24 | _ make sure that loadXxxx() methods are used after init() | |
| 15 | 25 | _ nasty errors when loadImage/Font/createFont/etc used outside | |
| 16 | 26 | ||
| 17 | 27 | _ selectInput() and selectOutput() freeze on OS X | |
| 18 | 28 | _ http://code.google.com/p/processing/issues/detail?id=445 | |
| 19 | 29 | ||
| 20 | - _ saving a PGraphics as jpg using save() makes a cmyk file | ||
| 21 | - _ need to shut off the alpha channel when writing | ||
| 22 | - _ http://code.google.com/p/processing/issues/detail?id=415 | ||
| 23 | - | ||
| 24 | 30 | _ definite present-mode weirdness with background colors | |
| 25 | 31 | ||
| 26 | 32 | _ OpenGL Applets won't load with JRE 6 update 21 or higher | |
| 27 | 33 | _ http://code.google.com/p/processing/issues/detail?id=429 | |
| 28 | 34 | ||
| 29 | - _ present mode is no longer centering on osx? | ||
| 30 | - _ bug: textAlign(RIGHT) is shutting off native fonts | ||
| 31 | - _ makes salaryper super ugly | ||
| 32 | - | ||
| 33 | 35 | _ clipping | |
| 34 | 36 | _ http://mrl.nyu.edu/~perlin/experiments/borg/render/index.html | |
| 35 | 37 | _ http://en.wikipedia.org/wiki/Clip_Mapping | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,7 +1,7 @@ | |||
| 1 | 1 | /* | |
| 2 | 2 | Part of the Processing project - http://processing.org | |
| 3 | 3 | ||
| 4 | - Copyright (c) 2005-10 Ben Fry and Casey Reas | ||
| 4 | + Copyright (c) 2005-11 Ben Fry and Casey Reas | ||
| 5 | 5 | ||
| 6 | 6 | This library is free software; you can redistribute it and/or | |
| 7 | 7 | modify it under the terms of the GNU Lesser General Public | |
@@ -21,6 +21,7 @@ | |||
| 21 | 21 | package processing.pdf; | |
| 22 | 22 | ||
| 23 | 23 | import java.awt.Font; | |
| 24 | + import java.awt.Graphics2D; | ||
| 24 | 25 | import java.io.*; | |
| 25 | 26 | import java.util.*; | |
| 26 | 27 | ||
@@ -100,6 +101,12 @@ protected void allocate() { | |||
| 100 | 101 | } | |
| 101 | 102 | ||
| 102 | 103 | ||
| 104 | + protected void defaultSettings() { // ignore | ||
| 105 | + super.defaultSettings(); | ||
| 106 | + textMode = SHAPE; | ||
| 107 | + } | ||
| 108 | + | ||
| 109 | + | ||
| 103 | 110 | public void beginDraw() { | |
| 104 | 111 | // long t0 = System.currentTimeMillis(); | |
| 105 | 112 | ||
@@ -125,7 +132,13 @@ public void beginDraw() { | |||
| 125 | 132 | } | |
| 126 | 133 | ||
| 127 | 134 | // System.out.println("beginDraw fonts " + (System.currentTimeMillis() - t)); | |
| 128 | - g2 = content.createGraphics(width, height, getMapper()); | ||
| 135 | + // g2 = content.createGraphics(width, height, getMapper()); | ||
| 136 | + // if (textMode == SHAPE) { | ||
| 137 | + g2 = content.createGraphicsShapes(width, height); | ||
| 138 | + // } else if (textMode == MODEL) { | ||
| 139 | + // g2 = content.createGraphics(width, height, getMapper()); | ||
| 140 | + // } | ||
| 141 | + // g2 = createGraphics(); | ||
| 129 | 142 | // g2 = template.createGraphics(width, height, mapper); | |
| 130 | 143 | } | |
| 131 | 144 | // System.out.println("beginDraw " + (System.currentTimeMillis() - t0)); | |
@@ -299,13 +312,20 @@ public void nextPage() { | |||
| 299 | 312 | } catch (Exception e) { | |
| 300 | 313 | e.printStackTrace(); | |
| 301 | 314 | } | |
| 315 | + g2 = createGraphics(); | ||
| 316 | + beginDraw(); | ||
| 317 | + style(savedStyle); | ||
| 318 | + } | ||
| 319 | + | ||
| 320 | + | ||
| 321 | + protected Graphics2D createGraphics() { | ||
| 302 | 322 | if (textMode == SHAPE) { | |
| 303 | - g2 = content.createGraphicsShapes(width, height); | ||
| 323 | + return content.createGraphicsShapes(width, height); | ||
| 304 | 324 | } else if (textMode == MODEL) { | |
| 305 | - g2 = content.createGraphics(width, height, mapper); | ||
| 325 | + return content.createGraphics(width, height, getMapper()); | ||
| 306 | 326 | } | |
| 307 | - beginDraw(); | ||
| 308 | - style(savedStyle); | ||
| 327 | + // Should not be reachable... | ||
| 328 | + throw new RuntimeException("Invalid textMode() selected for PDF."); | ||
| 309 | 329 | } | |
| 310 | 330 | ||
| 311 | 331 | ||
@@ -417,7 +437,7 @@ public void textFont(PFont which) { | |||
| 417 | 437 | /** | |
| 418 | 438 | * Change the textMode() to either SHAPE or MODEL. | |
| 419 | 439 | * <br/> | |
| 420 | - * This resets all renderer settings, and should therefore | ||
| 440 | + * This resets all renderer settings, and therefore must | ||
| 421 | 441 | * be called <EM>before</EM> any other commands that set the fill() | |
| 422 | 442 | * or the textFont() or anything. Unlike other renderers, | |
| 423 | 443 | * use textMode() directly after the size() command. | |
@@ -427,11 +447,13 @@ public void textMode(int mode) { | |||
| 427 | 447 | if (mode == SHAPE) { | |
| 428 | 448 | textMode = SHAPE; | |
| 429 | 449 | g2.dispose(); | |
| 430 | - g2 = content.createGraphicsShapes(width, height); | ||
| 450 | + // g2 = content.createGraphicsShapes(width, height); | ||
| 451 | + g2 = createGraphics(); | ||
| 431 | 452 | } else if (mode == MODEL) { | |
| 432 | 453 | textMode = MODEL; | |
| 433 | 454 | g2.dispose(); | |
| 434 | - g2 = content.createGraphics(width, height, mapper); | ||
| 455 | + // g2 = content.createGraphics(width, height, mapper); | ||
| 456 | + g2 = createGraphics(); | ||
| 435 | 457 | // g2 = template.createGraphics(width, height, mapper); | |
| 436 | 458 | } else if (mode == SCREEN) { | |
| 437 | 459 | throw new RuntimeException("textMode(SCREEN) not supported with PDF"); | |
@@ -591,10 +613,18 @@ protected void checkFont() { | |||
| 591 | 613 | ".ttf and .otf files with createFont()."); | |
| 592 | 614 | } else if (mapper.getAliases().get(textFont.getName()) == null) { | |
| 593 | 615 | //System.out.println("alias for " + name + " = " + mapper.getAliases().get(name)); | |
| 594 | - System.err.println("Use PGraphicsPDF.listFonts() to get a list of " + | ||
| 595 | - "fonts that can be used with PDF."); | ||
| 596 | - throw new RuntimeException("The font “" + textFont.getName() + "” " + | ||
| 597 | - "cannot be used with PDF Export."); | ||
| 616 | + // System.err.println("Use PGraphicsPDF.listFonts() to get a list of " + | ||
| 617 | + // "fonts that can be used with PDF."); | ||
| 618 | + // throw new RuntimeException("The font “" + textFont.getName() + "” " + | ||
| 619 | + // "cannot be used with PDF Export."); | ||
| 620 | + if (textFont.getName().equals("Lucida Sans")) { | ||
| 621 | + throw new RuntimeException("Use textMode(SHAPE) with the default " + | ||
| 622 | + "font when exporting to PDF."); | ||
| 623 | + } else { | ||
| 624 | + throw new RuntimeException("Use textMode(SHAPE) with " + | ||
| 625 | + "“" + textFont.getName() + "” " + | ||
| 626 | + "when exporting to PDF."); | ||
| 627 | + } | ||
| 598 | 628 | } | |
| 599 | 629 | } | |
| 600 | 630 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -112,6 +112,9 @@ X make sure that android is working again | |||
| 112 | 112 | X export is broken in 0192 | |
| 113 | 113 | X http://code.google.com/p/processing/issues/detail?id=487 | |
| 114 | 114 | ||
| 115 | + *** | ||
| 116 | + _ exceptions in setup() are locking the PDE | ||
| 117 | + | ||
| 115 | 118 | _ strange window flicker when first opened | |
| 116 | 119 | _ test libraries on android | |
| 117 | 120 | _ test .java files on desktop version | |
| Back | FazBrowse Home | New Git URL |
0 commit comments