more font work

This commit is contained in:
benfry
2010-02-16 19:40:50 +00:00
parent 613d47e72e
commit dd3facf5ca
4 changed files with 75 additions and 18 deletions

View File

@@ -227,7 +227,7 @@ public class CreateFont extends JFrame implements Tool {
Base.registerWindowCloseKeys(root, disposer);
Base.setIcon(this);
// setResizable(false);
setResizable(false);
pack();
// do this after pack so it doesn't affect layout
@@ -285,7 +285,7 @@ public class CreateFont extends JFrame implements Tool {
return;
}
String filename = filenameField.getText();
String filename = filenameField.getText().trim();
if (filename.length() == 0) {
JOptionPane.showMessageDialog(this, "Enter a file name for the font.",
"Lameness", JOptionPane.WARNING_MESSAGE);
@@ -295,23 +295,43 @@ public class CreateFont extends JFrame implements Tool {
filename += ".vlw";
}
// Please implement me properly. The schematic is below, but not debugged.
// http://dev.processing.org/bugs/show_bug.cgi?id=1464
// final String filename2 = filename;
// final int fontsize2 = fontsize;
// SwingUtilities.invokeLater(new Runnable() {
// public void run() {
try {
Font instance = (Font) table.get(list[selection]);
font = instance.deriveFont(Font.PLAIN, fontsize);
//PFont f = new PFont(font, smooth, all ? null : PFont.CHARSET);
PFont f = new PFont(font, smooth, charSelector.getCharacters());
// PFont f = new PFont(font, smooth, null);
// char[] charset = charSelector.getCharacters();
// ProgressMonitor progressMonitor = new ProgressMonitor(CreateFont.this,
// "Creating font", "", 0, charset.length);
// progressMonitor.setProgress(0);
// for (int i = 0; i < charset.length; i++) {
// System.out.println(charset[i]);
// f.index(charset[i]); // load this char
// progressMonitor.setProgress(i+1);
// }
// make sure the 'data' folder exists
File folder = editor.getSketch().prepareDataFolder();
f.save(new FileOutputStream(new File(folder, filename)));
} catch (IOException e) {
JOptionPane.showMessageDialog(this,
JOptionPane.showMessageDialog(CreateFont.this,
"An error occurred while creating font.",
"No font for you",
JOptionPane.WARNING_MESSAGE);
e.printStackTrace();
}
// }
// });
setVisible(false);
}

View File

@@ -1,3 +1,30 @@
PROCESSING 1.x (REV ????) - ?? February 2010
[ fonts ]
+ Fixed a problem with the Create Font tool ignoring the 'smooth' setting
on some systems.
+ Fixed a separate problem with the createFont() method also ignoring the
'smooth' setting.
+ Starting in this release, the createFont() method will only load characters
as they are used, which should greatly improve the font situation on
non-Roman systems like Japanese. This will use far less memory, and should
be all around much more efficient. Formerly, createFont() took several
seconds to run, depending on the speed of your system.
http://dev.processing.org/bugs/show_bug.cgi?id=1111
+ With the Create Font tool, you can also specify what Unicode character
blocks you'd like to use, making a much smaller font.
+ Fonts are no longer power of 2 by default. This should also make them more
memory efficient. With future OpenGL updates, this will work even better.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
PROCESSING 1.0.9 (REV 0171) - 20 October 2009
Happy birthday to Casey!

View File

@@ -2,8 +2,6 @@
X opengl sketches run at 30fps in present mode on OS X
_ still having problems w/ full screen non-FSEM
_ http://dev.processing.org/bugs/show_bug.cgi?id=1425
X "smooth" option being ignored in the Create Font tool
X http://dev.processing.org/bugs/show_bug.cgi?id=1461
X PFont not working well with lots of characters
X only create bitmap chars on the fly when needed (in createFont)
X Implement better caching mechanism when creating large fonts

View File

@@ -33,6 +33,23 @@ o just add a simple poly class? or don't use a poly?
X add imports for anything that's in the reference (selections from java.io)
o 'Array' in reference should be 'arrays' lowercase
fonts
X loading is very slow on the first time (getting all font names)
X create the tool object on startup, then use thread to getAllFonts()
X show a progress/status bar while it's happening?
X (would be useful to at least tell user that system not locked up)
X this was fixed in a much earlier release
X create font with user-specified charsets
o remember previous font selection when returning to the window
X "smooth" option being ignored in the Create Font tool
X http://dev.processing.org/bugs/show_bug.cgi?id=1461
X other font bugs handled
X http://dev.processing.org/bugs/show_bug.cgi?id=98
X http://dev.processing.org/bugs/show_bug.cgi?id=1111
o when resizing window, only resize the text display area
o just a matter of moving around the panels and BorderLayout
X it's a mess, just disable resizing
X move build scripts to something better like ant
X too much to maintain the multiple versions, too much code
X http://dev.processing.org/bugs/show_bug.cgi?id=151
@@ -44,6 +61,8 @@ _ http://processing.org/download/jre-6u18.zip, .tgz
_ only get the java files when doing a dist build
_ http://ant.apache.org/manual/CoreTasks/get.html
_ don't allow processing to run on snow leopard with 1.5
_ command line support is currently broken
_ http://dev.processing.org/bugs/show_bug.cgi?id=1048
_ some fixes can be found in the bug report
@@ -1164,6 +1183,12 @@ _ to pull code from a local folder
_ update will update classes from shared in the current folder
TOOLS / Create Font
E3 _ "create font" is slow, implement a progress indicator
E3 _ http://dev.processing.org/bugs/show_bug.cgi?id=1464
TOOLS / Color Picker
_ pasting into color picker doesn't update the color values
@@ -1215,19 +1240,6 @@ _ Bracket idenfication {} is not aware of comments //
_ http://dev.processing.org/bugs/show_bug.cgi?id=1450
TOOLS / Create Font
_ loading is very slow on the first time (getting all font names)
_ create the tool object on startup, then use thread to getAllFonts()
_ show a progress/status bar while it's happening?
_ (would be useful to at least tell user that system not locked up)
_ create font with user-specified charsets
_ may help solve: http://dev.processing.org/bugs/show_bug.cgi?id=98
_ when resizing window, only resize the text display area
_ just a matter of moving around the panels and BorderLayout
_ remember previous font selection when returning to the window
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////