diff options
author | Po Lu <luangruo@yahoo.com> | 2022-06-20 02:16:34 +0000 |
---|---|---|
committer | Po Lu <luangruo@yahoo.com> | 2022-06-20 02:16:34 +0000 |
commit | 382f7920abcf7df46b5b44462c6c71de54454b0e (patch) | |
tree | 62bd89a944b4bbed4da9f0c8760653450d23d1c8 /src/haiku_font_support.cc | |
parent | 9a6b6b1887c62b2f5aee75e213bd1f62bc6577f6 (diff) | |
download | emacs-382f7920abcf7df46b5b44462c6c71de54454b0e.tar.gz emacs-382f7920abcf7df46b5b44462c6c71de54454b0e.tar.bz2 emacs-382f7920abcf7df46b5b44462c6c71de54454b0e.zip |
Respect `:antialias' on Haiku
* src/haiku_font_support.cc (BFont_find): Pass through
FSPEC_ANTIALIAS.
(be_set_font_antialiasing): New function.
* src/haiku_support.h (enum haiku_font_specification): New enum
FSPEC_ANTIALIAS.
(struct haiku_font_pattern): New field `use_antialiasing'.
* src/haikufont.c (haikufont_pattern_to_entity)
(haikufont_spec_or_entity_to_pattern, haikufont_open): Respect
antialiasing.
(syms_of_haikufont): New defsym `:indices'.
Diffstat (limited to 'src/haiku_font_support.cc')
-rw-r--r-- | src/haiku_font_support.cc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/haiku_font_support.cc b/src/haiku_font_support.cc index ca6aaf71204..d824cc59ae2 100644 --- a/src/haiku_font_support.cc +++ b/src/haiku_font_support.cc @@ -598,6 +598,12 @@ BFont_find (struct haiku_font_pattern *pt) p->last = NULL; p->next_family = r; r = p; + + if (pt->specified & FSPEC_ANTIALIAS) + { + p->specified |= FSPEC_ANTIALIAS; + p->use_antialiasing = pt->use_antialiasing; + } } else if (sty_count) { @@ -623,6 +629,12 @@ BFont_find (struct haiku_font_pattern *pt) p->family_index = fi; p->style_index = si; + if (pt->specified & FSPEC_ANTIALIAS) + { + p->specified |= FSPEC_ANTIALIAS; + p->use_antialiasing = pt->use_antialiasing; + } + if (p->specified & FSPEC_SLANT && (p->slant == SLANT_OBLIQUE || p->slant == SLANT_ITALIC)) @@ -916,3 +928,14 @@ be_find_font_indices (struct haiku_font_pattern *pattern, return 1; } + +void +be_set_font_antialiasing (void *font, bool antialias_p) +{ + BFont *font_object; + + font_object = (BFont *) font; + font_object->SetFlags (antialias_p + ? B_FORCE_ANTIALIASING + : B_DISABLE_ANTIALIASING); +} |