From 2c3ad34caa9292cf7c52395c340b579ed0e79207 Mon Sep 17 00:00:00 2001 From: benfry Date: Sat, 15 Dec 2012 22:02:22 +0000 Subject: [PATCH] remove hint(ENABLE_NATIVE_FONTS) --- core/src/processing/core/PConstants.java | 2 ++ core/src/processing/core/PFont.java | 2 +- core/src/processing/core/PGraphics.java | 16 +++++++++++----- core/todo.txt | 11 +++++------ .../pdf/src/processing/pdf/PGraphicsPDF.java | 4 +++- todo.txt | 8 +++----- 6 files changed, 25 insertions(+), 18 deletions(-) diff --git a/core/src/processing/core/PConstants.java b/core/src/processing/core/PConstants.java index 1ddab8e51..544e1f3cc 100644 --- a/core/src/processing/core/PConstants.java +++ b/core/src/processing/core/PConstants.java @@ -438,7 +438,9 @@ public interface PConstants { // hints - hint values are positive for the alternate version, // negative of the same value returns to the normal/default state + @Deprecated static final int ENABLE_NATIVE_FONTS = 1; + @Deprecated static final int DISABLE_NATIVE_FONTS = -1; static final int DISABLE_DEPTH_TEST = 2; diff --git a/core/src/processing/core/PFont.java b/core/src/processing/core/PFont.java index 800af2d00..6060fcfb9 100644 --- a/core/src/processing/core/PFont.java +++ b/core/src/processing/core/PFont.java @@ -388,7 +388,7 @@ public class PFont implements PConstants { } // See if there's a native version of this font that can be used, // in case that's of interest later. - findNative(); +// findNative(); } diff --git a/core/src/processing/core/PGraphics.java b/core/src/processing/core/PGraphics.java index 3ffa7bb9e..08d126e92 100644 --- a/core/src/processing/core/PGraphics.java +++ b/core/src/processing/core/PGraphics.java @@ -1072,7 +1072,13 @@ public class PGraphics extends PImage implements PConstants { * @see PApplet#createGraphics(int, int, String, String) * @see PApplet#size(int, int) */ + @SuppressWarnings("deprecation") public void hint(int which) { + if (which == ENABLE_NATIVE_FONTS || + which == DISABLE_NATIVE_FONTS) { + showWarning("hint(ENABLE_NATIVE_FONTS) no longer supported. " + + "Use createFont() instead."); + } if (which > 0) { hints[which] = true; } else { @@ -3935,11 +3941,11 @@ public class PGraphics extends PImage implements PConstants { public void textFont(PFont which) { if (which != null) { textFont = which; - if (hints[ENABLE_NATIVE_FONTS]) { - //if (which.font == null) { - which.findNative(); - //} - } +// if (hints[ENABLE_NATIVE_FONTS]) { +// //if (which.font == null) { +// which.findNative(); +// //} +// } /* textFontNative = which.font; diff --git a/core/todo.txt b/core/todo.txt index fa9d3eee3..f4922e32b 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -15,7 +15,11 @@ X window at this point. And re-opening a new winodw is a lot of mess. X Better all around to just encourage the use of sketchFullScreen() X or cmd/ctrl-shift-R in the PDE. X make notes about methods removed from JSON to be conservative - +X remove default findNative() that was enabling native fonts w/ p5 +o when using loadFont(), don't enable native fonts unless hint() in use +o but on createFont(), we're probably OK +o might need to make reference notes about the two behaviors +X decision: remove hint(ENABLE_NATIVE_FONTS) _ PImage.resize() greater than loaded image size hangs Java App _ http://code.google.com/p/processing/issues/detail?id=1463 @@ -65,11 +69,6 @@ X saveTable("filename.tsv") or saveTable("filename.txt", "tsv") X createTable() method in PApplet X removed getUniqueXxxx() and some others, pending names -o when using loadFont(), don't enable native fonts unless hint() in use -o but on createFont(), we're probably OK -o might need to make reference notes about the two behaviors -_ decision: remove hint(ENABLE_NATIVE_FONTS) - _ implement mousePressed(Event) etc _ better to do this instead of bringing back the magic event _ or implementing the magic event on Android diff --git a/java/libraries/pdf/src/processing/pdf/PGraphicsPDF.java b/java/libraries/pdf/src/processing/pdf/PGraphicsPDF.java index 344988804..e5da31b99 100644 --- a/java/libraries/pdf/src/processing/pdf/PGraphicsPDF.java +++ b/java/libraries/pdf/src/processing/pdf/PGraphicsPDF.java @@ -60,13 +60,15 @@ public class PGraphicsPDF extends PGraphicsJava2D { /** Shared across instances because it's incredibly time-consuming to create. */ static protected DefaultFontMapper mapper; - static protected String fontList[]; + static protected String[] fontList; + /* public PGraphicsPDF() { // PDF always likes native fonts. Always. hint(ENABLE_NATIVE_FONTS); } + */ public void setPath(String path) { diff --git a/todo.txt b/todo.txt index 77c3daa48..df35ecf65 100644 --- a/todo.txt +++ b/todo.txt @@ -30,11 +30,9 @@ X add basics of retina support to the toolbar and header X getDefaultToolkit().getDesktopProperty("apple.awt.contentScaleFactor"); X paper over ArrayIndexOutOfBoundsException in JEditTextArea.xToOffset() -_ deal with underscores and "Find in Reference" -_ http://code.google.com/p/processing/issues/detail?id=1474 - -_ unable to open the URL link to reference after updated to 2.0b7 -_ http://code.google.com/p/processing/issues/detail?id=1465 +X "Find in Reference" largely broken in 2.0b7 +C http://code.google.com/p/processing/issues/detail?id=1456 +_ shouldn't we be splitting the reference? earlier X include debug mode as 'experimental'?