aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/fontset.c36
1 files changed, 29 insertions, 7 deletions
diff --git a/src/fontset.c b/src/fontset.c
index 1c2f4b7b8f1..1adc0e0cc19 100644
--- a/src/fontset.c
+++ b/src/fontset.c
@@ -1834,17 +1834,39 @@ new_fontset_from_font_name (Lisp_Object fontname)
1834 1834
1835#ifdef USE_FONT_BACKEND 1835#ifdef USE_FONT_BACKEND
1836int 1836int
1837new_fontset_from_font (f, font_object) 1837new_fontset_from_font (font_object)
1838 FRAME_PTR f;
1839 Lisp_Object font_object; 1838 Lisp_Object font_object;
1840{ 1839{
1841 Lisp_Object xlfd = Ffont_xlfd_name (font_object); 1840 Lisp_Object font_name = font_get_name (font_object);
1842 int id = new_fontset_from_font_name (xlfd); 1841 Lisp_Object font_spec = font_get_spec (font_object);
1843 Lisp_Object fontset = FONTSET_FROM_ID (id); 1842 Lisp_Object short_name, name, fontset;
1844 1843
1845 FONTSET_ASCII (fontset) = build_string (font_get_name (font_object)); 1844 if (NILP (auto_fontset_alist))
1845 short_name = build_string ("fontset-startup");
1846 else
1847 {
1848 char temp[32];
1849 int len = XINT (Flength (auto_fontset_alist));
1846 1850
1847 return id; 1851 sprintf (temp, "fontset-auto%d", len);
1852 short_name = build_string (temp);
1853 }
1854 ASET (font_spec, FONT_REGISTRY_INDEX, short_name);
1855 name = Ffont_xlfd_name (font_spec);
1856 if (NILP (name))
1857 {
1858 int i;
1859
1860 for (i = 0; i < FONT_SIZE_INDEX; i++)
1861 if ((i != FONT_FAMILY_INDEX) && (i != FONT_REGISTRY_INDEX))
1862 ASET (font_spec, i, Qnil);
1863 name = Ffont_xlfd_name (font_spec);
1864 if (NILP (name))
1865 abort ();
1866 }
1867 fontset = make_fontset (Qnil, name, Qnil);
1868 FONTSET_ASCII (fontset) = font_name;
1869 return XINT (FONTSET_ID (fontset));
1848} 1870}
1849 1871
1850struct font * 1872struct font *