After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 119081 - Allow font size specification in pixels
Allow font size specification in pixels
Status: RESOLVED FIXED
Product: pango
Classification: Platform
Component: general
1.2.x
Other Linux
: Normal normal
: 1.8 API freeze
Assigned To: pango-maint
pango-maint
Depends on:
Blocks:
 
 
Reported: 2003-08-04 13:36 UTC by Owen Taylor
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Adds the ability to set pixel sizes. (14.70 KB, patch)
2004-07-13 04:33 UTC, Chris Lahey
none Details | Review
Adds the ability to set pixel size. (15.87 KB, patch)
2004-07-19 17:06 UTC, Chris Lahey
none Details | Review
Patch as applied (19.09 KB, patch)
2004-12-16 03:25 UTC, Owen Taylor
none Details | Review

Description Owen Taylor 2003-08-04 13:36:02 UTC
In some apps, specifying a particular pixel size of font
is necessary - for such apps having a:

 pango_font_description_set_absolute_size()

that took pixels/PANGO_SCALE for screen, points/PANGO_SCALE
for PS (that is, the same units as the extents) would
be useful

The alternative would be something like:

 pango_context_get_dpi()

to allow getting the DPI number that is being used to 
convert points to pixels.
Comment 1 Joaquin Cuenca Abela 2003-08-04 15:02:13 UTC
FWIW, it may be a good idea to be able to retrieve the dpi on each 
axis.  Most displays have the same resolution on both axis, but I 
think that some of them support different resolutions on X than on Y.

Also, I don't see both functions 
(pango_font_description_set_absolute_size() and pango_context_get_dpi
()) as exclusive.  It makes sense to me to have both of them, even 
if it's not strictly need.

Cheers,
Comment 2 Chris Lahey 2004-07-13 04:33:38 UTC
Created attachment 29494 [details] [review]
Adds the ability to set pixel sizes.

Doesn't implement this on windows, but windows will still compile and work. 
It'll just ignore the size_is_absolute flag.
Comment 3 Chris Lahey 2004-07-19 17:06:09 UTC
Created attachment 29657 [details] [review]
Adds the ability to set pixel size.

Fixed missing glyph drawing, but still doesn't get the size right on windows.
Comment 4 Owen Taylor 2004-08-31 20:37:37 UTC
Got lost on future milestone. Definitely for 1.8.
Comment 5 Owen Taylor 2004-12-16 03:25:02 UTC
Applied with some changes:

 - Decided after all to go with the non-paired
   pango_font_description_set_absolute_size() / 
   pango_font_description_get_size_is_absolute() - setting the
   size and then saying "oh, yeah, that size was absolute" seems
   odd to me.

 - Dropped the handling of FC_PIXEL_SIZE in
   pango_fc_font_description_from_pattern(); don't think it's clear
   enough how that would interact. Documented that it is ignored.

 - Implemented simply for Win32 (just convert pixels => points
   before calling pango_win32_font_new())

 - Doc improvements

 - pango_attr_size_absolute_new()  => pango_attr_size_new_absolute()

 - Added Since: 1.8 annotations
 
 - Added some temporary variables to deal with huge line lengths

 - Use indentation as documented in docs/TEXT/coding-style

===
Wed Dec 15 22:09:42 2004  Owen Taylor  <otaylor@redhat.com>

        Add pixel sizes for fonts (#119081, patch from Chris Lahey)

        * pango/fonts.c pango/pango-font.h:
        Add pango_font_description_set_absolute_size(),
        pango_font_description_get_size_is_absolute()

        * pango/pango-attributes.[ch]: Add pango_attr_size_new_absolute(),
        change PANGO_ATTR_SIZE from PangoAttrInt to PangoAttrSize
        (preserves compat because first component is identical)

        * pango/pangowin32-fontmap.c (pango_win32_font_map_load_font):
        For absolute sizes, convert pixels to points, before
        calling pango_win32_font_new().

        * pango/pangofc-fontmap.c pango/pangoft2.c pango/pangoxft-font.c:
        Handle absolute sizes.
Comment 6 Owen Taylor 2004-12-16 03:25:21 UTC
Created attachment 34884 [details] [review]
Patch as applied