/* Font driver on Mac OSX Core text.
- Copyright (C) 2009-2015 Free Software Foundation, Inc.
+ Copyright (C) 2009-2016 Free Software Foundation, Inc.
This file is part of GNU Emacs.
GNU Emacs is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
+the Free Software Foundation, either version 3 of the License, or (at
+your option) any later version.
GNU Emacs is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
{
long percent_val = lround (val * 100);
- if (percent_val == -40 || percent_val == 56)
+ if (percent_val == -40)
{
CTFontRef font = NULL;
CFStringRef name =
{
CFIndex weight = mac_font_get_weight (font);
- if (percent_val == -40)
- {
- /* Workaround for crash when displaying Oriya characters
- with Arial Unicode MS on OS X 10.11. */
- if (weight == 5)
- val = 0;
- }
- else /* percent_val == 56 */
- {
- if (weight == 9)
- /* Adjustment for HiraginoSans-W7 on OS X 10.11. */
- val = 0.4;
- }
+ /* Workaround for crash when displaying Oriya characters
+ with Arial Unicode MS on OS X 10.11. */
+ if (weight == 5)
+ val = 0;
CFRelease (font);
}
}
!= (spacing >= FONT_SPACING_MONO)))
continue;
- /* Don't use a color bitmap font unless its family is
- explicitly specified. */
- if ((sym_traits & kCTFontTraitColorGlyphs) && NILP (family))
+ /* Don't use a color bitmap font until it is supported on
+ free platforms. */
+ if (sym_traits & kCTFontTraitColorGlyphs)
continue;
if (j > 0
static unsigned
macfont_encode_char (struct font *font, int c)
{
- struct macfont_info *macfont_info = (struct macfont_info *) font;
CGGlyph glyph;
block_input ();
result = false;
else
{
- CFIndex desc_languages_count, i, languages_count;
+ CFRange range = CFRangeMake (0, CFArrayGetCount (desc_languages));
+ CFIndex i, languages_count = CFArrayGetCount (languages);
- desc_languages_count = CFArrayGetCount (desc_languages);
- languages_count = CFArrayGetCount (languages);
for (i = 0; i < languages_count; i++)
- if (!CFArrayContainsValue (desc_languages,
- CFRangeMake (0, desc_languages_count),
- CFArrayGetValueAtIndex (languages, i)))
- {
- result = false;
- break;
- }
+ {
+ CFStringRef language = CFArrayGetValueAtIndex (languages, i);
+
+ if (!CFArrayContainsValue (desc_languages, range, language)
+ /* PingFang SC contains "zh" and "zh-Hant" as covered
+ languages, but does not contain "zh-Hans". */
+ && !(CFEqual (language, CFSTR ("zh-Hans"))
+ && CFArrayContainsValue (desc_languages, range,
+ CFSTR ("zh"))))
+ {
+ result = false;
+ break;
+ }
+ }
CFRelease (desc_languages);
}
void
syms_of_macfont (void)
{
- static struct font_driver mac_font_driver;
-
/* Core Text, for Mac OS X. */
DEFSYM (Qmac_ct, "mac-ct");
macfont_driver.type = Qmac_ct;