[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ft] Fitting text to a limited display area
From: |
Ric Flinn |
Subject: |
[ft] Fitting text to a limited display area |
Date: |
Wed, 15 Mar 2006 08:59:10 -0800 (PST) |
Hello, I'm hoping to get some advice on the problem
I'm working on. In my application, I am given a
limited display area for a single row of text. The
text box is sized based on the number of characters it
can hold, say one row of 20 characters. For any
selected font, I need to chose the correct scale to
fit any text string of the maximum length inside the
box, with no character extending beyond the edge.
Using FT_Set_Pixel_Sizes() gets me close, but often
this will scale certain characters beyond the allowed
bounds (many characters may be too tall to fit in the
allowed height). The current idea is to reduce the
scale until all characters fit. Can this be done
reliably by using the data generated in
face->size->metrics to calculate the maximum
dimensions for the font?
Sorry if the question is not clear. Any
recommendations would be much appreciated.
- Ric
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
- [ft] Fitting text to a limited display area,
Ric Flinn <=