Re: Font size and screen resolution



On Wed, 30 Jan 2002, Jason Maiorana wrote:


I seems I am officially in charge of font handling now, due to trying
to
hack up FreeType support:)  I'm trying to get away from the frankly
horribly hard-coded font list in there now, but I'm having trouble with
the
ctual rendering for FreeType.  I'm guessing the trouble you see lies in
suck_font, yes?  I shall have to investigate what FreeType does at
differing resolutions.


Out of curiousity, could you go into a little detail about the difficulty
you are having with freetype.

Absolutely!  Any help is welcome:)

All the fun is in lib/font.c, inside #ifdef HAVE_FREETYPE.  In
freetype_load_string(), I manage to find the size of the string, and that
seems ok.  In freetype_render_string(), I have FreeType render into its
bitmaps, and then I call freetype_copy_glyph_bitmap() to copy that into the
Dia pixmap.  However, the actual copy operation (gdk_draw_gray_image())
bombs.  It's been a while since I've looked at it, I'm thinking there's a
disagreement on bitmap layouts between GDK and FreeType.  I'm also slightly
worried that the bitmap size I get from FT for a single glyph is 263786x50.

What's also odd is the difference between the height used for finding
bounding boxes etc, and that used when drawing -- the renderer uses
renderer->font_height, which is ddisplay_transform_length()ed, but
calc_width() seems to ignore the renderer and the transformation.

To see the problems, configure with --enable-freetype and try doing
anything with text in Dia.  #define LARS_TRACE_MESSAGES in lib/font.c to
see a trace of what happens.

-Lars

-- 
Lars Clausen (http://shasta.cs.uiuc.edu/~lrclause)| Hårdgrim of Numenor
"I do not agree with a word that you say, but I   |----------------------------
will defend to the death your right to say it."   | Where are we going, and
    --Evelyn Beatrice Hall paraphrasing Voltaire  | what's with the handbasket?



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