aboutsummaryrefslogtreecommitdiffstats
path: root/src/font.c
diff options
context:
space:
mode:
authorAndreas Schwab2010-12-27 18:29:38 +0100
committerAndreas Schwab2010-12-27 18:29:38 +0100
commit2f7c71a117244e1967009e8a4a0c82cd7388b470 (patch)
tree476a0f8e86b99e7feb2f6dce1807c00de350a95b /src/font.c
parentc4b607ede11227b48de24b861f728d8fd20e6753 (diff)
downloademacs-2f7c71a117244e1967009e8a4a0c82cd7388b470.tar.gz
emacs-2f7c71a117244e1967009e8a4a0c82cd7388b470.zip
Remove unused declarations
* src/buffer.c: Remove unused declarations. * src/buffer.h: Likewise. * src/charset.h: Likewise. * src/composite.h: Likewise. * src/dispextern.h: Likewise. * src/dispnew.c: Likewise. * src/font.h: Likewise. * src/fontset.c: Likewise. * src/fontset.h: Likewise. * src/intervals.h: Likewise. * src/keymap.h: Likewise. * src/lisp.h: Likewise. * src/syntax.c: Likewise. * src/syntax.h: Likewise. * src/termhooks.h: Likewise. * src/window.h: Likewise. * src/xsettings.h: Likewise. * src/xterm.c: Likewise. * src/xterm.h: Likewise. * src/chartab.c (sub_char_table_ref): Make static. * src/dispnew.c (line_hash_code, required_matrix_height) (required_matrix_width): Likewise. * src/eval.c (interactive_p, apply_lambda): Likewise. * src/fns.c (string_make_multibyte, copy_hash_table, hash_clear): Likewise. * src/font.c (QCadstyle, QCregistry, font_make_spec) (font_parse_fcname, font_encode_char, font_at): Likewise. * src/frame.c (x_frame_get_arg): Likewise. * src/keymap.c (get_keyelt): Likewise. * src/lread.c (read_filtered_event): Likewise. * src/print.c (write_string_1): Likewise. * src/window.c (delete_window, window_height, window_width) (foreach_window): Likewise. * src/xrdb.c (x_get_customization_string, x_get_resource): Likewise. * src/xterm.c (x_scroll_bar_clear, xembed_set_info) (xembed_send_message): Likewise. * src/eval.c (run_hook_list_with_args): Delete. * src/font.c (font_unparse_gtkname, font_update_lface): Likewise. * src/terminal.c (get_terminal_param): Likewise. * src/xterm.c (x_alloc_lighter_color_for_widget): Likewise.
Diffstat (limited to 'src/font.c')
-rw-r--r--src/font.c143
1 files changed, 9 insertions, 134 deletions
diff --git a/src/font.c b/src/font.c
index ae933df75c8..948df3f2244 100644
--- a/src/font.c
+++ b/src/font.c
@@ -123,7 +123,8 @@ static const struct table_entry width_table[] =
123 { 200, { "ultra-expanded", "ultraexpanded", "wide" }} 123 { 200, { "ultra-expanded", "ultraexpanded", "wide" }}
124}; 124};
125 125
126Lisp_Object QCfoundry, QCadstyle, QCregistry; 126Lisp_Object QCfoundry;
127static Lisp_Object QCadstyle, QCregistry;
127/* Symbols representing keys of font extra info. */ 128/* Symbols representing keys of font extra info. */
128Lisp_Object QCspacing, QCdpi, QCscalable, QCotf, QClang, QCscript, QCavgwidth; 129Lisp_Object QCspacing, QCdpi, QCscalable, QCotf, QClang, QCscript, QCavgwidth;
129Lisp_Object QCantialias, QCfont_entity, QCfc_unknown_spec; 130Lisp_Object QCantialias, QCfont_entity, QCfc_unknown_spec;
@@ -164,7 +165,7 @@ static struct font_driver_list *font_driver_list;
164 165
165/* Creaters of font-related Lisp object. */ 166/* Creaters of font-related Lisp object. */
166 167
167Lisp_Object 168static Lisp_Object
168font_make_spec (void) 169font_make_spec (void)
169{ 170{
170 Lisp_Object font_spec; 171 Lisp_Object font_spec;
@@ -220,6 +221,7 @@ static int font_pixel_size (FRAME_PTR f, Lisp_Object);
220static Lisp_Object font_open_entity (FRAME_PTR, Lisp_Object, int); 221static Lisp_Object font_open_entity (FRAME_PTR, Lisp_Object, int);
221static Lisp_Object font_matching_entity (FRAME_PTR, Lisp_Object *, 222static Lisp_Object font_matching_entity (FRAME_PTR, Lisp_Object *,
222 Lisp_Object); 223 Lisp_Object);
224static unsigned font_encode_char (Lisp_Object, int);
223 225
224/* Number of registered font drivers. */ 226/* Number of registered font drivers. */
225static int num_font_drivers; 227static int num_font_drivers;
@@ -1305,7 +1307,7 @@ font_unparse_xlfd (Lisp_Object font, int pixel_size, char *name, int nbytes)
1305 1307
1306 This function tries to guess which format it is. */ 1308 This function tries to guess which format it is. */
1307 1309
1308int 1310static int
1309font_parse_fcname (char *name, Lisp_Object font) 1311font_parse_fcname (char *name, Lisp_Object font)
1310{ 1312{
1311 char *p, *q; 1313 char *p, *q;
@@ -1676,90 +1678,6 @@ font_unparse_fcname (Lisp_Object font, int pixel_size, char *name, int nbytes)
1676 return (p - name); 1678 return (p - name);
1677} 1679}
1678 1680
1679/* Store GTK-style font name of FONT (font-spec or font-entity) in
1680 NAME (NBYTES length), and return the name length. F is the frame
1681 on which the font is displayed; it is used to calculate the point
1682 size. */
1683
1684int
1685font_unparse_gtkname (Lisp_Object font, struct frame *f, char *name, int nbytes)
1686{
1687 char *p;
1688 int len = 1;
1689 Lisp_Object family, weight, slant, size;
1690 int point_size = -1;
1691
1692 family = AREF (font, FONT_FAMILY_INDEX);
1693 if (! NILP (family))
1694 {
1695 if (! SYMBOLP (family))
1696 return -1;
1697 family = SYMBOL_NAME (family);
1698 len += SBYTES (family);
1699 }
1700
1701 weight = font_style_symbolic (font, FONT_WEIGHT_INDEX, 0);
1702 if (EQ (weight, Qnormal))
1703 weight = Qnil;
1704 else if (! NILP (weight))
1705 {
1706 weight = SYMBOL_NAME (weight);
1707 len += SBYTES (weight);
1708 }
1709
1710 slant = font_style_symbolic (font, FONT_SLANT_INDEX, 0);
1711 if (EQ (slant, Qnormal))
1712 slant = Qnil;
1713 else if (! NILP (slant))
1714 {
1715 slant = SYMBOL_NAME (slant);
1716 len += SBYTES (slant);
1717 }
1718
1719 size = AREF (font, FONT_SIZE_INDEX);
1720 /* Convert pixel size to point size. */
1721 if (INTEGERP (size))
1722 {
1723 Lisp_Object font_dpi = AREF (font, FONT_DPI_INDEX);
1724 int dpi = 75;
1725 if (INTEGERP (font_dpi))
1726 dpi = XINT (font_dpi);
1727 else if (f)
1728 dpi = f->resy;
1729 point_size = PIXEL_TO_POINT (XINT (size), dpi);
1730 len += 11;
1731 }
1732 else if (FLOATP (size))
1733 {
1734 point_size = (int) XFLOAT_DATA (size);
1735 len += 11;
1736 }
1737
1738 if (len > nbytes)
1739 return -1;
1740
1741 p = name + sprintf (name, "%s", SDATA (family));
1742
1743 if (! NILP (weight))
1744 {
1745 char *q = p;
1746 p += sprintf (p, " %s", SDATA (weight));
1747 q[1] = toupper (q[1]);
1748 }
1749
1750 if (! NILP (slant))
1751 {
1752 char *q = p;
1753 p += sprintf (p, " %s", SDATA (slant));
1754 q[1] = toupper (q[1]);
1755 }
1756
1757 if (point_size > 0)
1758 p += sprintf (p, " %d", point_size);
1759
1760 return (p - name);
1761}
1762
1763/* Parse NAME (null terminated) and store information in FONT 1681/* Parse NAME (null terminated) and store information in FONT
1764 (font-spec or font-entity). If NAME is successfully parsed, return 1682 (font-spec or font-entity). If NAME is successfully parsed, return
1765 0. Otherwise return -1. */ 1683 0. Otherwise return -1. */
@@ -3039,7 +2957,7 @@ font_has_char (FRAME_PTR f, Lisp_Object font, int c)
3039 2957
3040/* Return the glyph ID of FONT_OBJECT for character C. */ 2958/* Return the glyph ID of FONT_OBJECT for character C. */
3041 2959
3042unsigned 2960static unsigned
3043font_encode_char (Lisp_Object font_object, int c) 2961font_encode_char (Lisp_Object font_object, int c)
3044{ 2962{
3045 struct font *font; 2963 struct font *font;
@@ -3144,50 +3062,6 @@ font_clear_prop (Lisp_Object *attrs, enum font_property_index prop)
3144 attrs[LFACE_FONT_INDEX] = font; 3062 attrs[LFACE_FONT_INDEX] = font;
3145} 3063}
3146 3064
3147void
3148font_update_lface (FRAME_PTR f, Lisp_Object *attrs)
3149{
3150 Lisp_Object spec;
3151
3152 spec = attrs[LFACE_FONT_INDEX];
3153 if (! FONT_SPEC_P (spec))
3154 return;
3155
3156 if (! NILP (AREF (spec, FONT_FOUNDRY_INDEX)))
3157 attrs[LFACE_FOUNDRY_INDEX] = SYMBOL_NAME (AREF (spec, FONT_FOUNDRY_INDEX));
3158 if (! NILP (AREF (spec, FONT_FAMILY_INDEX)))
3159 attrs[LFACE_FAMILY_INDEX] = SYMBOL_NAME (AREF (spec, FONT_FAMILY_INDEX));
3160 if (! NILP (AREF (spec, FONT_WEIGHT_INDEX)))
3161 attrs[LFACE_WEIGHT_INDEX] = FONT_WEIGHT_FOR_FACE (spec);
3162 if (! NILP (AREF (spec, FONT_SLANT_INDEX)))
3163 attrs[LFACE_SLANT_INDEX] = FONT_SLANT_FOR_FACE (spec);
3164 if (! NILP (AREF (spec, FONT_WIDTH_INDEX)))
3165 attrs[LFACE_SWIDTH_INDEX] = FONT_WIDTH_FOR_FACE (spec);
3166 if (! NILP (AREF (spec, FONT_SIZE_INDEX)))
3167 {
3168 int point;
3169
3170 if (INTEGERP (AREF (spec, FONT_SIZE_INDEX)))
3171 {
3172 Lisp_Object val;
3173 int dpi = f->resy;
3174
3175 val = Ffont_get (spec, QCdpi);
3176 if (! NILP (val))
3177 dpi = XINT (val);
3178 point = PIXEL_TO_POINT (XINT (AREF (spec, FONT_SIZE_INDEX)) * 10,
3179 dpi);
3180 attrs[LFACE_HEIGHT_INDEX] = make_number (point);
3181 }
3182 else if (FLOATP (AREF (spec, FONT_SIZE_INDEX)))
3183 {
3184 point = XFLOAT_DATA (AREF (spec, FONT_SIZE_INDEX)) * 10;
3185 attrs[LFACE_HEIGHT_INDEX] = make_number (point);
3186 }
3187 }
3188}
3189
3190
3191/* Selecte a font from ENTITIES (list of font-entity vectors) that 3065/* Selecte a font from ENTITIES (list of font-entity vectors) that
3192 supports C and matches best with ATTRS and PIXEL_SIZE. */ 3066 supports C and matches best with ATTRS and PIXEL_SIZE. */
3193 3067
@@ -3781,8 +3655,9 @@ font_filter_properties (Lisp_Object font,
3781 at index POS. If C is negative, get C from the current buffer or 3655 at index POS. If C is negative, get C from the current buffer or
3782 STRING. */ 3656 STRING. */
3783 3657
3784Lisp_Object 3658static Lisp_Object
3785font_at (int c, EMACS_INT pos, struct face *face, struct window *w, Lisp_Object string) 3659font_at (int c, EMACS_INT pos, struct face *face, struct window *w,
3660 Lisp_Object string)
3786{ 3661{
3787 FRAME_PTR f; 3662 FRAME_PTR f;
3788 int multibyte; 3663 int multibyte;