Re: PangoFontMetrics

"Venkat Ramakrishnan" <venkat_ramakrishnan hotmail com> writes:
> I am new to gtk+ so also to pango and I read Pango is the thing
> to use for application using fonts etc . I am designing a UI for
> a application (a user interface for a mediaplayer) on Linux. I have
> so many text strings to display ,with various font and color, so that
> it looks attractive :).

Just be careful - if you hardcode colors and font sizes, users with
vision problems won't be able to make the fonts larger or use a
high-contrast theme, for example. Most media players are unusable for
disabled users, due to hardcoded colors/fonts and lack of keyboard
navigation. Windows Media Player has a "native widgets with standard
colors" theme to avoid this problem, and also keeps key navigation
working even with the strange themes.

> I calculate the max ascent/descent returned for each string so that
> I can allocate the space for each string propely in a table kind of
> thing. The reason of using the PangoMetrics is only the name suggests
> I can get all the above parameters from it only .

The way this is normally done is to go ahead and create your
PangoLayout, and use the extents of the layout. You want to use the
"logical extents" rather than the "ink extents" for arranging your


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