diff options
| author | Jason Rumney | 2008-03-01 23:04:20 +0000 |
|---|---|---|
| committer | Jason Rumney | 2008-03-01 23:04:20 +0000 |
| commit | a823468b902592d4cee5e27ae4ef492110fbb372 (patch) | |
| tree | ad46d646d7224e452168fe6d3160f91b525ae649 /src | |
| parent | 98329671e24e9e3b37111f1f7c13479b667e6946 (diff) | |
| download | emacs-a823468b902592d4cee5e27ae4ef492110fbb372.tar.gz emacs-a823468b902592d4cee5e27ae4ef492110fbb372.zip | |
(w32font_full_name): Report point size for scalable fonts.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/w32font.c | 31 |
2 files changed, 29 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 02d1626893c..0a087cbc85e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2008-03-01 Jason Rumney <jasonr@gnu.org> | ||
| 2 | |||
| 3 | * w32font.c (w32font_full_name): Report point size for scalable fonts. | ||
| 4 | |||
| 1 | 2008-03-01 Kim F. Storm <storm@cua.dk> | 5 | 2008-03-01 Kim F. Storm <storm@cua.dk> |
| 2 | 6 | ||
| 3 | * dispextern.h (CHAR_GLYPH_SPACE_P): Check for default face. | 7 | * dispextern.h (CHAR_GLYPH_SPACE_P): Check for default face. |
diff --git a/src/w32font.c b/src/w32font.c index ff0344c7912..fad3960180e 100644 --- a/src/w32font.c +++ b/src/w32font.c | |||
| @@ -1553,11 +1553,20 @@ w32font_full_name (font, font_obj, pixel_size, name, nbytes) | |||
| 1553 | char *name; | 1553 | char *name; |
| 1554 | int nbytes; | 1554 | int nbytes; |
| 1555 | { | 1555 | { |
| 1556 | int len; | 1556 | int len, height, outline; |
| 1557 | char *p; | 1557 | char *p; |
| 1558 | Lisp_Object antialiasing, weight = Qnil; | 1558 | Lisp_Object antialiasing, weight = Qnil; |
| 1559 | 1559 | ||
| 1560 | len = strlen (font->lfFaceName) + 21; /* :pixelsize=SIZE */ | 1560 | len = strlen (font->lfFaceName); |
| 1561 | |||
| 1562 | outline = EQ (AREF (font_obj, FONT_FOUNDRY_INDEX), Qoutline); | ||
| 1563 | |||
| 1564 | /* Represent size of scalable fonts by point size. But use pixelsize for | ||
| 1565 | raster fonts to indicate that they are exactly that size. */ | ||
| 1566 | if (outline) | ||
| 1567 | len += 11; /* -SIZE */ | ||
| 1568 | else | ||
| 1569 | len = strlen (font->lfFaceName) + 21; | ||
| 1561 | 1570 | ||
| 1562 | if (font->lfItalic) | 1571 | if (font->lfItalic) |
| 1563 | len += 7; /* :italic */ | 1572 | len += 7; /* :italic */ |
| @@ -1579,10 +1588,20 @@ w32font_full_name (font, font_obj, pixel_size, name, nbytes) | |||
| 1579 | p = name; | 1588 | p = name; |
| 1580 | p += sprintf (p, "%s", font->lfFaceName); | 1589 | p += sprintf (p, "%s", font->lfFaceName); |
| 1581 | 1590 | ||
| 1582 | if (font->lfHeight) | 1591 | height = font->lfHeight ? eabs (font->lfHeight) : pixel_size; |
| 1583 | p += sprintf (p, ":pixelsize=%d", eabs (font->lfHeight)); | 1592 | |
| 1584 | else if (pixel_size > 0) | 1593 | if (height > 0) |
| 1585 | p += sprintf (p, ":pixelsize=%d", pixel_size); | 1594 | { |
| 1595 | if (outline) | ||
| 1596 | { | ||
| 1597 | float pointsize = height * 72.0 / one_w32_display_info.resy; | ||
| 1598 | /* Round to nearest half point. */ | ||
| 1599 | pointsize = round (pointsize * 2) / 2; | ||
| 1600 | p += sprintf (p, "-%1.1f", pointsize); | ||
| 1601 | } | ||
| 1602 | else | ||
| 1603 | p += sprintf (p, ":pixelsize=%d", height); | ||
| 1604 | } | ||
| 1586 | 1605 | ||
| 1587 | if (font->lfItalic) | 1606 | if (font->lfItalic) |
| 1588 | p += sprintf (p, ":italic"); | 1607 | p += sprintf (p, ":italic"); |