We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › PGraphicsPDF.listFonts()
Page Index Toggle Pages: 1
PGraphicsPDF.listFonts() (Read 1091 times)
PGraphicsPDF.listFonts()
Jun 12th, 2009, 2:45am
 
would like to get the List of Fonts available to pdf-renderer
refering to:

http://dev.processing.org/reference/everything/javadoc/processing/pdf/PGraphicsPDF.html

just seems to throw up strange error messages...

anyone up for a simple solution?

cheers,
daniel
Re: PGraphicsPDF.listFonts()
Reply #1 - Jun 12th, 2009, 4:34am
 
What code have you tried and what kind of error messages are you getting?
Re: PGraphicsPDF.listFonts()
Reply #2 - Jun 12th, 2009, 4:44am
 
Anyway, I had the listing with the following code:

Code:
  pdf = createGraphics(400, 400, PDF, "multipage.pdf");
pdf.beginDraw();

String[] fonts = ((PGraphicsPDF) pdf).listFonts();
for (int i = 0; i < fonts.length; i++)
{
println(fonts[i]);
}
Re: PGraphicsPDF.listFonts()
Reply #3 - Jun 12th, 2009, 6:41am
 
hi PhiLho!
many thanks for your quick help!


when i changed your Code to this:

import processing.pdf.*;

PGraphics pdf = createGraphics(400, 400, PDF, "multipage.pdf");
pdf.beginDraw();
 
 String[] fonts = ((PGraphicsPDF) pdf).listFonts();
 for (int i = 0; i < fonts.length; i++)
 {
   println(fonts[i]);
 }



it worked fine for me...

++

although i am not sure why some fonts appear with characters like:

?¬’Ë–?’© Pro M
?¬’Ë–?’© Pro R

or

?¬’˃SƒVƒbƒN Pro B
?¬’˃SƒVƒbƒN Pro EL

or

?????? Pro W6
?????? Std W8


this does not happen when using PFont.list();
Re: PGraphicsPDF.listFonts()
Reply #4 - Jun 12th, 2009, 8:36am
 
_TD_ wrote on Jun 12th, 2009, 6:41am:
although i am not sure why some fonts appear with characters like

I saw this too (on Windows), maybe the internal font name is Unicode (some Asian fonts perhaps).
Re: PGraphicsPDF.listFonts()
Reply #5 - Jun 13th, 2009, 12:29am
 
i had a look at my fonts inside Illustrater and there are some that have asian-characters in the name...

processing-console(message area) can not display unicode, can it?
just wonder how you do a japanese "hello world" then...
Re: PGraphicsPDF.listFonts()
Reply #6 - Jun 13th, 2009, 4:53am
 
Page Index Toggle Pages: 1