John Owen | 1 Oct 14:17 2014

[ft] How can I render monospace text in any font?

Given any typical font, not necessarily a monospace one, how can I
render text in a monospace style? I've tried messing around with
drawing the bitmaps of the glyphs individually, but I can never get
the x and y alignment between glyphs right. I'm using OpenGL and
python, but the answer should be adaptable to any graphics context or
language. I've also opened a question on SO if anyone wanted to use

Apologies if I screw something up, I'm new to mailing lists.
Phil Endecott | 27 Sep 17:30 2014

[ft] Metrics for pre-rendered glyphs - am I doing this right?

Dear List,

Thanks for helping with my earlier question.  I'm now going to 
describe what I'm doing to check if I've got it right - now that 
I don't have obvious off-by-one errors, it's hard to spot the 
more subtle mistakes even with a magnifier!

I have an OpenGL application in which I use FreeType to pre-render 
glyphs into a texture; when I want to draw text onto the display I 
use OpenGL to copy glyph rectangles from that texture to rectangles 
on the display.

In the simplest version, for each glyph I store the bitmap_left, 
bitmap_top and linearHoriAdvance values (all in 64ths of a pixel, 
though bitmap_left and bitmap_top are always whole numbers of pixels).  
Then drawing algorithm is (pseudo-code):

int x = x0, y = y0;  // in 64ths of a pixel
for each glyph {
  find the bitmap in the texture
  copy it to the screen with its bottom-left corner at
  ( round((x+bitmap_left)/64), round((y+bitmap_top-bitmap_height)/64) )
  x += linearHoriAdvance
  x += kerning  

Does that look reasonable?

For smaller font sizes, I am attempting to do sub-pixel horizontal 
positioning.  For each glyph, I store 2 or 4 (or more) bitmaps with 
(Continue reading)

Phil Endecott | 27 Sep 01:38 2014

[ft] bitmap_left description

Dear Experts,

The docs for bitmap_left say:

     This is the bitmap's left bearing expressed in integer
     pixels. Of course, this is only valid if the format is

I'm rendering individual glyphs from a TrueType font using
FT_Load_Glyph() followed by FT_Render_Glyph().  Having done
that I had been struggling to work out the metrics for the
result.  Then I discovered that bitmap_left and bitmap_top
seem to tell me exactly what I need to know - but I had
been avoiding them because this not a bitmap font and the
description quoted above.

Is it OK to use bitmap_left/top after FT_Render_Glyph()?
Is this a documentation issue?

Thanks,  Phil.
Thomas H. Puzia | 26 Sep 20:39 2014

[ft] how to uninstall freetype

Hi there,

I installed freetype in a local directory on my MacPro (OS X 10.9.5) and am having trouble with running all my other programs now!


:/Users/tpuzia/Science/local/lib> make
dyld: Symbol not found: __cg_png_create_info_struct
  Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
  Expected in: /Users/tpuzia/Science/local/lib/libPng.dylib
 in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
make: error: unable to locate xcodebuild, please make sure the path to the Xcode folder is set correctly!
make: error: You can set the path to the Xcode folder using /usr/bin/xcode-select -switch

Please, help!


  Thomas H. Puzia, Institute of Astrophysics, Pontificia Universidad Catolica de Chile

This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of this email by you is prohibited.

Freetype mailing list
Freetype <at>
luserdroog . | 23 Sep 12:23 2014

[ft] Weird advance values after FT_Set_Transform()

Hello all,

I'm having some difficulty using FT_Set_Transform with FT_Render_Glyph.
The program in this gist demonstrates the problem.

Having scaled, I appear to get a nice horizontal vector (512,0). But,
setting a matrix with 2x scaling and 45-degree rotation is yielding
unexpected values (1,1).

Does anyone have a clue what I've done wrong?
Werner LEMBERG | 15 Sep 18:15 2014

[ft] Gamma issues

I've just found this interesting site:

Given that really most software today fails to correctly scale images
with proper gamma, there's no wonder that there are similar problems
with the gamma stuff in the FreeType's CFF module.  We are ahead of
time, it seems...

Christopher Kurtis Koeber | 10 Sep 23:03 2014

[ft] deletion of pointer to incomplete type 'FT_LibraryRec_'; no destructor called



So I have a working implementation of the FreeType library in my project and I wish to clean up the library when I am no longer using it like a good programmer should.


Anyway, I have an instance of the FreeType library declared like so:


FT_Library ft;


But when I try and call the deconstructor of the instance like so:


delete ft;


I get the following warning in my Visual C++ compiler:


Warning               1              warning C4150: deletion of pointer to incomplete type 'FT_LibraryRec_'; no destructor called


Is there something I am doing wrong?




Christopher Kurtis Koeber


Freetype mailing list
Freetype <at>
Louis Semprini | 12 Aug 18:41 2014

[ft] iOS 7 system font Helvetica Neue horribly mis-hinted with FreeType 2.5.3


Thank you so much for the open source miracle that is FreeType.

I really hope I am doing something simple wrong here, because there must be thousands of iOS app vendors trying the same thing every day.  It seems all OpenGL iOS apps would want to do just what I am doing here.  Also, if indeed iOS uses FreeType for its own rendering, then this should definitely work ?!?!

I have some absolutely minimal FreeType code that just tries to render simple A-Z glyphs with the iOS system font, "Helvetica Neue Interface."

I am seeing FT results that are horribly disfigured like the attached file bad_hinting.png or you can see the same image here:

As you can see, random character strokes are thick and random strokes are thin, as if FT were trying to fit my text to some coarse grid.

I ONLY see this disfigurement with the iOS Helvetica fonts (_H_Helvetica.ttc, _H_HelveticaNeue.ttc, _H_HelveticaNeueInterface.ttc).  Many other fonts are OK with my code including Arial Unicode MS, several Chinese fonts, Segoe UI, and several of the Google fonts like Noto.

I ONLY see the disfigurement if I use the TrueType bytecode hinter inside FT.   I do not see the disfigurement with FT auto-hinting or with hinting disabled.

Note these fonts do not contain any 'gasp' table.

My test is at 39 pixel em size. If I choose MUCH smaller sizes, I see even more extreme distortions, like for example the whole middle segment of a lowercase 'a' disappears.  If you like I can send more sample pix.

For testing purposes, you can download a sample font that shows the problem here:

The testing font is a .ttc containing 7 .ttfs.  You can use any of the .ttfs to see the problem; I used the first .ttf in my test.

My code is essentially this (yes, my real code checks all error return values):

    FT_Library library = ft_get_library();
    FT_New_Face(library, filename, ttc_slot /*0*/, &ff.ft_face );

   FT_Set_Pixel_Sizes(ff.ft_face, 39, 39);
                      FT_LOAD_DEFAULT |
                      FT_LOAD_RENDER | // create actual bitmap!

If I use FT_LOAD_FORCE_AUTOHINT or if I use FT_LOAD_NO_HINTING, the output I get is nice (a bit fuzzy).  But if I use FreeType's native TTF bytecode hinter by passing neither of those options, things go wonky as above.

I still get the same problem if I try to use FT_LOAD_NO_BITMAP and/or FT_LOAD_IGNORE_TRANSFORM.

p.s. before someone hijacks this thread by asking an unrelated question: although iOS apps cannot directly open the system .ttf/.ttc font files due to Apple fascism, it IS possible for an app to legally suck over all the bits of a TrueType file into its memory, as explained at  and I'm sure thousands of OpenGL apps do this.  But this is not relevant to my question: the bug/problem I am explaining here happens even if you root your phone and open the font file directly, and even if you copy the .ttc file to a Windows computer and run FreeType there.

Freetype mailing list
Freetype <at>
Nguyen Nguyen | 8 Aug 13:36 2014

[ft] I need some guide include library to IDE.

Dear team

I try include free style library to Visual studio C++ 2008 and Dev C++ but it dont realize

Error on VS C++
" error LNK2019: unresolved external symbol _FT_Init_FreeType referenced in function _main
1>E:\Demo\Helloworld\Debug\Helloworld.exe : fatal error LNK1120: 1 unresolved externals"

On Dev C++
"22 E:\Demo\HelloDev\main.c undefined reference to `FT_Init_FreeType'"

Can you help me ? I need some guide include library to IDE.

Thanks you
Nguyen Quang Nguyen.
Cell phone:+84
Yahoo mail: bitx2000 <at>
Google mail: kingmax2004 <at>
Skype: niitpn_bitmax
Freetype mailing list
Freetype <at>
Dohyun Kim | 8 Aug 05:48 2014

[ft] On centering glyphs around vertical baseline


In vertical rendering mode of freetype, glyphs are placed
center-aligned around vertical baseline, which however seems to be a

I have done some simple tests and compared the result of freetype
(plus harfbuzz) with those wordpad on windows 8.1 and textedit on mac
os x 10.9.  In all three cases, Source Han Sans [1], a free pan-CJK
font recently released by Adobe, was used. The text used for testing
was <U+65E5 U+302A U+0049 U+004D U+65E5>.

Attached image file is the result of comparison.  As shown in the
image, only freetype puts glyphs center-aligned.  So there seems to be
a bug in freetype's vertical rendering mode.

FYI, this issue has been spotted while pondering over how to support
vertical typesetting of combining Hangul Jamo characters, on which a
discussion is going on at issue tracker of Source Han Sans. [2]


Best Regards,

Dohyun Kim
Seoul, Republic of Korea
Freetype mailing list
Freetype <at>
Mario Todorov | 29 Jul 10:11 2014

[ft] A problem with Cyrillic fonts

I need to make my player Marantz UD5007 (which uses FreeType) to show Cyrillic subtitles, but instead it
shows only things like 3/4, D with a slash in the middle and so on. What am I to do? I tried saving the .srt file
in ANSI, Unicode, Unicode big endian and UTF-8. The first and the last showed different signs (not the
right ones) and the others weren't even recognized as subtitle files. I hope you can help me.

Have a nice day,