Complete the transition to Noto as the default font.

- Both Noto and Noto Sans CJK JP are now used as font fallbacks,
  allowing to cover a rather large range of characters. This also makes
  it possible to mix the two fonts easily.
- Remove VL-Gothic from packages and from AboutSystem
- Add Noto fonts to the dependencies of the Haiku package.

This provides a similar look for all languages as discussed on the
mailing list.
This commit is contained in:
Adrien Destugues
2017-03-05 12:58:17 +01:00
parent 64e5cee534
commit 34fbc56b3f
9 changed files with 59 additions and 41 deletions
+1 -1
View File
@@ -81,6 +81,7 @@ rule DefineDefaultBuildProfiles
mercurial mercurial
nano nano
noto noto
noto_cjk_jp
openssh openssh
p7zip p7zip
pe pe
@@ -88,7 +89,6 @@ rule DefineDefaultBuildProfiles
subversion subversion
timgmsoundfont timgmsoundfont
vision vision
vl_gothic
wpa_supplicant wpa_supplicant
wqy_microhei wqy_microhei
# xz_utils can't be built with gcc2, so we install it for # xz_utils can't be built with gcc2, so we install it for
+6 -11
View File
@@ -1191,18 +1191,13 @@ AboutView::_CreateCreditsView()
.SetLicenses("OpenGroup", "DEC", NULL)); .SetLicenses("OpenGroup", "DEC", NULL));
// TODO: URL // TODO: URL
// VL-Gothic font // Noto fonts copyright
_AddPackageCredit(PackageCredit("VL-Gothic font") _AddPackageCredit(PackageCredit("Noto fonts")
.SetCopyrights(B_TRANSLATE(COPYRIGHT_STRING "1990-2003 Wada Laboratory," .SetCopyrights(B_TRANSLATE(COPYRIGHT_STRING
" the University of Tokyo."), COPYRIGHT_STRING "2012-2016 Google Internationalization team."),
"2003-2004 Electronic Font Open Laboratory (/efont/).",
COPYRIGHT_STRING "2003-2012 M+ FONTS PROJECT.",
COPYRIGHT_STRING "2006-2012 Daisuke SUZUKI.",
COPYRIGHT_STRING "2006-2012 Project Vine.",
B_TRANSLATE("MIT license. All rights reserved."),
NULL) NULL)
.SetLicense(kBSDThreeClause) .SetLicense("SIL Open Font Licence v1.1")
.SetURL("http://vlgothic.dicey.org/")); .SetURL("http://www.google.com/get/noto/"));
// expat copyrights // expat copyrights
_AddPackageCredit(PackageCredit("expat") _AddPackageCredit(PackageCredit("expat")
+2 -1
View File
@@ -81,5 +81,6 @@ requires {
lib:libstdc++ lib:libstdc++
lib:libsupc++ lib:libsupc++
lib:libz lib:libz
vl_gothic noto
noto_sans_cjk_jp
} }
+2 -1
View File
@@ -72,5 +72,6 @@ requires {
lib:libstdc++ lib:libstdc++
lib:libsupc++ lib:libsupc++
lib:libz lib:libz
vl_gothic noto
noto_sans_cjk_jp
} }
+2 -1
View File
@@ -81,5 +81,6 @@ requires {
lib:libstdc++ lib:libstdc++
lib:libsupc++ lib:libsupc++
lib:libz lib:libz
vl_gothic noto
noto_sans_cjk_jp
} }
+2 -1
View File
@@ -119,5 +119,6 @@ requires {
lib:libstdc++ lib:libstdc++
lib:libsupc++ lib:libsupc++
lib:libz lib:libz
vl_gothic noto
noto_sans_cjk_jp
} }
+2 -1
View File
@@ -118,5 +118,6 @@ requires {
lib:libstdc++ lib:libstdc++
lib:libsupc++ lib:libsupc++
lib:libz lib:libz
vl_gothic noto
noto_sans_cjk_jp
} }
+2 -1
View File
@@ -107,5 +107,6 @@ requires {
lib:libsolv lib:libsolv
lib:libsolvext lib:libsolvext
lib:libz lib:libz
vl_gothic noto
noto_sans_cjk_jp
} }
+40 -23
View File
@@ -305,7 +305,7 @@ GlyphLayoutEngine::_WriteLockAndAcquireFallbackEntry(
int32 length, FontCacheReference& fallbackCacheReference, int32 length, FontCacheReference& fallbackCacheReference,
FontCacheEntry*& fallbackEntry) FontCacheEntry*& fallbackEntry)
{ {
// We need the fallback font, since potentially, we have to obtain missing // We need a fallback font, since potentially, we have to obtain missing
// glyphs from it. We need to obtain the fallback font while we have not // glyphs from it. We need to obtain the fallback font while we have not
// locked anything, since locking the FontManager with the write-lock held // locked anything, since locking the FontManager with the write-lock held
// can obvisouly lead to a deadlock. // can obvisouly lead to a deadlock.
@@ -319,29 +319,46 @@ GlyphLayoutEngine::_WriteLockAndAcquireFallbackEntry(
entry->ReadUnlock(); entry->ReadUnlock();
} }
if (gFontManager->Lock()) { // TODO: We always get the fallback glyphs from the Noto family, but of
// TODO: We always get the fallback glyphs from VL Gothic at the // course the fallback font should a) contain the missing glyphs at all
// moment, but of course the fallback font should a) contain the // and b) be similar to the original font. So there should be a mapping
// missing glyphs at all and b) be similar to the original font. // of some kind to know the most suitable fallback font.
// So there should be a mapping of some kind to know the most static const char* fallbacks[] = {
// suitable fallback font. "Noto Sans",
FontStyle* fallbackStyle = gFontManager->GetStyleByIndex( "Noto Sans CJK JP",
"VL Gothic", 0); NULL
if (fallbackStyle != NULL) { };
ServerFont fallbackFont(*fallbackStyle, font.Size());
gFontManager->Unlock(); int i = 0;
// Force the write-lock on the fallback entry, since we
// don't transfer or copy GlyphCache objects from one cache // Try to get the glyph from the fallback fonts
// to the other, but create new glyphs which are stored in while(fallbacks[i] != NULL)
// "entry" in any case, which requires the write cache for {
// sure (used FontEngine of fallbackEntry). if (gFontManager->Lock()) {
fallbackEntry = FontCacheEntryFor(fallbackFont, forceVector, entry, FontStyle* fallbackStyle = gFontManager->GetStyleByIndex(
utf8String, length, fallbackCacheReference, true); fallbacks[i], 0);
// NOTE: We don't care if fallbackEntry is NULL, fetching if (fallbackStyle != NULL) {
// alternate glyphs will simply not work. ServerFont fallbackFont(*fallbackStyle, font.Size());
} else gFontManager->Unlock();
gFontManager->Unlock();
// Force the write-lock on the fallback entry, since we
// don't transfer or copy GlyphCache objects from one cache
// to the other, but create new glyphs which are stored in
// "entry" in any case, which requires the write cache for
// sure (used FontEngine of fallbackEntry).
fallbackEntry = FontCacheEntryFor(fallbackFont, forceVector,
entry, utf8String, length, fallbackCacheReference, true);
if (fallbackEntry != NULL)
break;
} else
gFontManager->Unlock();
}
i++;
} }
// NOTE: We don't care if fallbackEntry is still NULL, fetching
// alternate glyphs will simply not work.
if (!entry->WriteLock()) { if (!entry->WriteLock()) {
FontCache::Default()->Recycle(entry); FontCache::Default()->Recycle(entry);