cdrchops / gbui

Automatically exported from code.google.com/p/gbui
GNU Lesser General Public License v2.1
0 stars 0 forks source link

style dont load a font #17

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. put the complete path in the style file

What is the expected output? What do you see instead?
text use the specifyed font

Please provide any additional information below.
if the font is installed in the system that's works fine (only write the
name of the font)

i have a solution (attached).
this try load the font with the full path. if not found take the system font.

Original issue reported on code.google.com by gabriel.tandil@gmail.com on 5 Mar 2009 at 5:01

Attachments:

GoogleCodeExporter commented 9 years ago
this is not a bug, is a enhacement and the proposed change to the class

Original comment by gabriel.tandil@gmail.com on 13 Mar 2009 at 2:56

GoogleCodeExporter commented 9 years ago
A possible solution would to allow a path be provided that can load the font 
for us 
as needed:
{{{
try {
            Font t = Font.createFont(Font.TRUETYPE_FONT, 
ComboBoxTest.class.getClassLoader().getResource("rsrc/fonts/adventure.ttf").open
Strea
m());
            GraphicsEnvironment ge = 
GraphicsEnvironment.getLocalGraphicsEnvironment();
            ge.registerFont(t);
            System.out.println("FONTFAMILY:"+t.getFamily());
        } catch (Exception e) {
            e.printStackTrace();
        } 
}}}

Original comment by Captain....@gmail.com on 8 Dec 2009 at 6:31