Bug 1111 : Implement better caching mechanism when creating large fonts
Last modified: 2010-02-16 11:07




Status:
RESOLVED
Resolution:
FIXED -
Priority:
P2
Severity:
enhancement

 

Reporter:
ohyeahq
Assigned To:
fry

Attachment Type Created Size Actions

Description:   Opened: 2008-12-27 23:31
newest 1.0.1 / windows

Can't create or use Japanese fonts at all. PDE - Create fonts -
MS-Gothic/UIGothic etc - include all chars - gives java errors (memory leaks?):

Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java
heap space
at processing.core.PImage.init(PImage.java:144)
at processing.core.PImage.<init>(PImage.java:130)
at processing.core.PFont.<init>(PFont.java:649)
at processing.app.tools.CreateFont.build(CreateFont.java:329)
at processing.app.tools.CreateFont$7.actionPerformed(CreateFont.java:223)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

Alternatively, PFont f = createFont("MS-Gothic", 24); etc shows nothing on
screen.

Any workaround???
Additional Comment #1 From ohyeahq 2008-12-29 20:09
Smaller fonts (24pt) seems OK; 48pt NG.
Additional Comment #2 From fry 2009-02-19 19:15
See bug #98.

In the meantime, use the createFont() method, and pass in a char[] array of
characters you want to use, rather than trying to convert the tens of
thousands of characters in a full unicode font.
http://processing.org/reference/createFont_.html

Changing this to an enhancement request.
Additional Comment #3 From fry 2010-02-16 11:07
For future releases, the createFont() method will only load characters as
they are used, which should greatly improve the font situation on non-Roman
systems like Japanese. Or with the Create Font tool, you can also specify
what unicode character blocks you'd like to use, making a much smaller font.