Skip to content
Prev 5579 / 15076 Next

Possible mac-specific bug in svg (cairo) graphics

Yan,
On Jan 28, 2009, at 6:33 , Yan Wong wrote:

            
Ah, sorry, my bad - I forgot that you're on 10.4 and I was testing  
with 10.5. I do remember that 10.4 is missing italics from several  
default fonts (e.g. Helvetica). You can enable fontconfig debug using  
FC_DEBUG=1 -- that will at least tell you what fontconfig found.

To make things worse, FreeType on Mac is quite buggy and screws up  
numbering of fonts within a container which results in incorrect  
styles - it is something we try to work around, but if FT recognizes  
the wrong style we can't do anything about it. From what I can see  
this is what happens -- the main difference between 10.4 and 10.5 is  
that Arial and friends are supplied as (rf-style) font suitcases in  
10.4 which is what FT has trouble dealing with. In 10.5 they come as  
individual fonts which FT can deal with just fine.

I know that this is catching straws, but of one the few fonts that  
come as TTF in 10.4 is "Euphemia UCAS", so this will produce italic  
output even on 10.4:

svg("test.svg", width=4,4,8)
par(family="Euphemia UCAS")
plot.new()
text(0.5,0.5,labels=expression(italic("This should be in italics")))
dev.off()

Although this is a nuisance, working around bugs in 3rd party  
libraries on older systems is not high on my priority list, os I  
cannot promise anything, but maybe I'll get to it...
All styles are in a single file and FT picks the wrong one,  
unfortunately.
FC_DEBUG=1 may help, but FT/cairographics don't have any debugging env  
vars AFAIR.

Cheers,
Simon