aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ftfont.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/ftfont.c b/src/ftfont.c
index 0f1d2b1421b..574b7841067 100644
--- a/src/ftfont.c
+++ b/src/ftfont.c
@@ -468,7 +468,6 @@ ftfont_spec_pattern (spec, fc_charset_idx, otlayout, otspec)
468 FcLangSet *langset = NULL; 468 FcLangSet *langset = NULL;
469 int n; 469 int n;
470 int dpi = -1; 470 int dpi = -1;
471 int spacing = -1;
472 int scalable = -1; 471 int scalable = -1;
473 Lisp_Object name = Qnil; 472 Lisp_Object name = Qnil;
474 Lisp_Object script = Qnil; 473 Lisp_Object script = Qnil;
@@ -485,8 +484,6 @@ ftfont_spec_pattern (spec, fc_charset_idx, otlayout, otspec)
485 484
486 if (INTEGERP (AREF (spec, FONT_DPI_INDEX))) 485 if (INTEGERP (AREF (spec, FONT_DPI_INDEX)))
487 dpi = XINT (AREF (spec, FONT_DPI_INDEX)); 486 dpi = XINT (AREF (spec, FONT_DPI_INDEX));
488 if (INTEGERP (AREF (spec, FONT_SPACING_INDEX)))
489 spacing = XINT (AREF (spec, FONT_SPACING_INDEX));
490 if (INTEGERP (AREF (spec, FONT_AVGWIDTH_INDEX)) 487 if (INTEGERP (AREF (spec, FONT_AVGWIDTH_INDEX))
491 && XINT (AREF (spec, FONT_AVGWIDTH_INDEX)) == 0) 488 && XINT (AREF (spec, FONT_AVGWIDTH_INDEX)) == 0)
492 scalable = 1; 489 scalable = 1;
@@ -589,9 +586,6 @@ ftfont_spec_pattern (spec, fc_charset_idx, otlayout, otspec)
589 if (dpi >= 0 586 if (dpi >= 0
590 && ! FcPatternAddDouble (pattern, FC_DPI, dpi)) 587 && ! FcPatternAddDouble (pattern, FC_DPI, dpi))
591 goto err; 588 goto err;
592 if (spacing >= 0
593 && ! FcPatternAddInteger (pattern, FC_SPACING, spacing))
594 goto err;
595 if (scalable >= 0 589 if (scalable >= 0
596 && ! FcPatternAddBool (pattern, FC_SCALABLE, scalable ? FcTrue : FcFalse)) 590 && ! FcPatternAddBool (pattern, FC_SCALABLE, scalable ? FcTrue : FcFalse))
597 goto err; 591 goto err;
@@ -633,6 +627,7 @@ ftfont_list (frame, spec)
633 int fc_charset_idx; 627 int fc_charset_idx;
634 char otlayout[15]; /* For "otlayout:XXXX" */ 628 char otlayout[15]; /* For "otlayout:XXXX" */
635 struct OpenTypeSpec *otspec = NULL; 629 struct OpenTypeSpec *otspec = NULL;
630 int spacing = -1;
636 631
637 if (! fc_initialized) 632 if (! fc_initialized)
638 { 633 {
@@ -643,6 +638,8 @@ ftfont_list (frame, spec)
643 pattern = ftfont_spec_pattern (spec, &fc_charset_idx, otlayout, &otspec); 638 pattern = ftfont_spec_pattern (spec, &fc_charset_idx, otlayout, &otspec);
644 if (! pattern) 639 if (! pattern)
645 return Qnil; 640 return Qnil;
641 if (INTEGERP (AREF (spec, FONT_SPACING_INDEX)))
642 spacing = XINT (AREF (spec, FONT_SPACING_INDEX));
646 registry = AREF (spec, FONT_REGISTRY_INDEX); 643 registry = AREF (spec, FONT_REGISTRY_INDEX);
647 family = AREF (spec, FONT_FAMILY_INDEX); 644 family = AREF (spec, FONT_FAMILY_INDEX);
648 if (! NILP (family)) 645 if (! NILP (family))
@@ -661,7 +658,7 @@ ftfont_list (frame, spec)
661 658
662 objset = FcObjectSetBuild (FC_FOUNDRY, FC_FAMILY, FC_WEIGHT, FC_SLANT, 659 objset = FcObjectSetBuild (FC_FOUNDRY, FC_FAMILY, FC_WEIGHT, FC_SLANT,
663 FC_WIDTH, FC_PIXEL_SIZE, FC_SPACING, FC_SCALABLE, 660 FC_WIDTH, FC_PIXEL_SIZE, FC_SPACING, FC_SCALABLE,
664 FC_CHARSET, FC_FILE, 661 FC_FILE,
665#ifdef FC_CAPABILITY 662#ifdef FC_CAPABILITY
666 FC_CAPABILITY, 663 FC_CAPABILITY,
667#endif /* FC_CAPABILITY */ 664#endif /* FC_CAPABILITY */
@@ -676,6 +673,16 @@ ftfont_list (frame, spec)
676 { 673 {
677 Lisp_Object entity; 674 Lisp_Object entity;
678 675
676 if (spacing >= 0)
677 {
678 int this;
679
680 if ((FcPatternGetInteger (fontset->fonts[i], FC_SPACING, 0, &this)
681 == FcResultMatch)
682 && spacing != this)
683 continue;
684 }
685
679#ifdef FC_CAPABILITY 686#ifdef FC_CAPABILITY
680 if (otlayout[0]) 687 if (otlayout[0])
681 { 688 {