Created attachment 28944 [details] cairo_bitmap_font_scale.c This bug was reported as bug 18001 about 1 year ago. Actually it is not only reproducible with PS backend, but also with image and PDF backend perhaps all backend. It is not only reproducible with freetype fonts either. I can reproduce it with Windows. See (https://bugzilla.mozilla.org/show_bug.cgi?id=448186) However I filed this bug against freetype font backend, because I think different font backend may require different fixes. Please correct me if I were wrong. Steps to reproduce: 1) Enable bitmap font on Ubuntu or use Solaris. See: http://www.alanbriolat.co.uk/2009/04/enable-bitmap-fonts-on-ubuntu-jaunty/ 2) Run fc-match Courier Make sure you get a *.pcf or *.pcf.gz file. 3) Compile and run attached cairo_bitmap_font_scale.c. 4) If you change "Courier" to a non bitmap font, the result is correct. I've proposed a draft fix half a year ago in mozilla bug 448186. Attached try.patch. However I don't think it's the right fix. If we do _transform_glyph_bitmap() there, it will make the glyph unreadable if it is scaled down to 50% or 30%. For PS, if we use "scale" operator inside "/Glyphs", we can get a better result. (suggested by Adrian Johnson in https://bugzilla.mozilla.org/show_bug.cgi?id=448186#c7) But I don't know how should I pass the "CTM" through "scaled_glyph".
Created attachment 28945 [details] [review] try.patch
Created attachment 28946 [details] the buggy result
Created attachment 28947 [details] result after applying try.patch
> For PS, if we use "scale" operator inside "/Glyphs", we can get a better > result. > (suggested by Adrian Johnson in > https://bugzilla.mozilla.org/show_bug.cgi?id=448186#c7) > But I don't know how should I pass the "CTM" through "scaled_glyph". User fonts is the feature that will give you better control of bitmap fonts in PS/PDF output: http://www.cairographics.org/manual/cairo-user-font.html An example of creating bitmap fonts using user fonts is in cairo/test/user-font-mask.c
This issue (how to scale bitmaps) should be brought up on cairo list for discussion first. Thanks.
This is now being discussed: http://lists.freedesktop.org/archives/fontconfig/2012-December/004498.html
In fact, this recent commit of mind fixed your test case: http://cgit.freedesktop.org/cairo/commit/?id=b94a519aad3d5b50aa6de47ee16ee6a099de9791 The fontconfig part is still ongoing, but that's not in the scope of this bug anymore. That said, there seems to be issues with vertical text and bitmap fonts, so someone may want to investigate.
This should be fixed now.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.