freetype
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft] Fwd: Calculating terminal emulator cell size


From: Jonathan Glines
Subject: Re: [ft] Fwd: Calculating terminal emulator cell size
Date: Sat, 19 Nov 2016 19:44:35 -0700

On Fri, Nov 18, 2016 at 1:32 PM, Werner LEMBERG <address@hidden> wrote:
>
>> I'm using FreeType for a terminal emulator application, and I need
>> some advice for calculating the appropriate size for cells in the
>> terminal emulator, given a monospace font.
>
> Have you tried the various FT_SIZE_REQUEST_TYPE_XXX requests?

I hadn't even noticed the size request options. I'll make a note to
try out FT_SIZE_REQUEST_TYPE_CELL, since it looks like that option was
made for terminal emulators.

>> Right now I'm just using FT_FaceRec.bbox as follows: [...]
>
> No time to check that in detail.  If the above fails I suggest that
> you get the metrics from, say, digit zero and use this to scale the
> font – if the font is intended as a mono-space font, the digits *must*
> fit :-)
>
>
>     Werner

I ended up checking the width of the 'M' glyph and it's working fine
now. Beautifully really. Thanks for the advice!

Jonathan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]