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 › Fonts, display and PDF
Page Index Toggle Pages: 1
Fonts, display and PDF (Read 775 times)
Fonts, display and PDF
Sep 1st, 2008, 2:24pm
 
Hi,

I've got some trouble regarding fonts.

I was using a vlw version of Monaco-9 on MacOS to visualize some information. That works fine as long as I don't want to 'print' the screen to PDF (the bitmap vs. vector font issue).

I changed loadFont("Monaco-9.vlw") to createFont("Monaco", 9) and now I'm able to generate a PDF, but text placement is broken now. seems like textWidth() and textAlign() don't work/return the right values anymore.

Any hints?

regards
 Ilu
Re: Fonts, display and PDF
Reply #1 - Sep 1st, 2008, 4:07pm
 
have you tried textMode(SHAPE) to see if there's any difference?

are you writing lengths of text or individual characters?

maybe try createFont() with a larger size, then use textSize() later (i doubt this will help, but it's worth a try).

there are some sizing/placement issues, which i haven't been able to find fixes for just yet, but it may be along the lines of what you're seeing.
http://dev.processing.org/bugs/show_bug.cgi?id=866
http://dev.processing.org/bugs/show_bug.cgi?id=806
Re: Fonts, display and PDF
Reply #2 - Sep 1st, 2008, 5:12pm
 
Hi Fry,

textMode(SHAPE) is not supported for the default renderer. I don't use OpenGL.

I'm measuring whole sentences or words, not single characters.

textSize() didn't work as well.

The two bugs are not the issue as well. I made a picture from both versions:
http://www.foobarquarium.de/temp/fonthing.png

The vector characters are wider, but the measuring is the same as for the bitmap characters...

thanks
 Ilu
Re: Fonts, display and PDF
Reply #3 - Sep 1st, 2008, 5:31pm
 
textMode(SHAPE) is supported for PDF, though--you have to call it on the PGraphicsPDF directly (if you're using beginRecord) or if you're using PDF with the size() command it should just work.

can you create a minimal sketch that shows the problem, then use Tools > Archive Sketch, and post a bug report for it? i'll look into what's going on.
Re: Fonts, display and PDF
Reply #4 - Sep 2nd, 2008, 3:00pm
 
Hi fry,

I'll try invoking textMode(SHAPE) on the PGraphicsPDF and I'll file you a bugreport as soon as I'm back from vacation.

thanks for now...
Page Index Toggle Pages: 1