summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorDaeHyun Sung <sungdh86+git@gmail.com>2020-06-28 21:41:32 +0900
committerCaolán McNamara <caolanm@redhat.com>2020-07-02 20:26:28 +0200
commit50a41b211e7b9bce7cf10d286861071574702638 (patch)
tree107b9a0438e536a65ce6fe8bea9b955faffab9b1 /svtools
parenta751d9c414fc63f36ae4b54b8adbaba042b31f60 (diff)
Hardcode script for "Noto" CJK fonts & add USCRIPT_JAMO
1. Hardcode script for "Noto" CJK fonts. The "Noto" CJK fonts support to Simplified Chinese, Traditional Chinese, Traditional Chinese HK, Japanese, and Korean (Pan-CJK fonts). Nowadays, Noto CJK Fonts are shown '简繁'. Noto font's KR(Korean, 한국어/한글) & JP(Japanese,日本語) represent Korean(KR, It shows '한글') and Japanese(JP, It shows '日本語'), respectively. These are not expressed in Chinese fonts, such as Simplified Chinese(简) and Traditional Chinese(繁). Also, Both TC(Traditional Chinese) and HK(Hong Kong) represent 繁. It don't shown 简繁. so, SC(Simplified Chinese) represent 简, It don't shown 简繁 So, I fixed Font select option's Noto CJK-series font Examples on LibreOffice Noto Sans CJK HK 简繁 -> Noto Sans CJK HK 繁 Noto Sans CJK JP 简繁 -> Noto Sans CJK JP 日本語 Noto Sans CJK KR 简繁 -> Noto Sans CJK KR 한글 Noto Sans CJK SC 简繁 -> Noto Sans CJK SC 简 Noto Sans CJK TC 简繁 -> Noto Sans CJK TC 繁 Noto Sans Mono CJK HK 简繁 -> Noto Sans Mono CJK HK 繁 Noto Sans Mono CJK JP 简繁 -> Noto Sans Mono CJK JP 日本語 Noto Sans Mono CJK KR 简繁 -> Noto Sans Mono CJK KR 한글 Noto Sans Mono CJK SC 简繁 -> Noto Sans Mono CJK SC 简 Noto Sans Mono CJK TC 简繁 -> Noto Sans Mono CJK TC 繁 Noto Serif CJK JP 简繁 -> Noto Serif CJK JP 日本語 Noto Serif CJK KR 简繁 -> Noto Serif CJK KR 한글 Noto Serif CJK SC 简繁 -> Noto Serif CJK SC 简 Noto Serif CJK TC 简繁 -> Noto Serif CJK TC 繁 check the Noto CJK Fonts https://github.com/googlefonts/noto-cjk 2. add USCRIPT_JAMO It related with commit, ff0ed60c769da6f46acd9388e46922987e321d06 "change USCRIPT_JAMO language value for Unicode" Jamo(자모/字母) is composition elements of Korean Alphabet, Hangul Syllable(음절) Example] 각 Decomposition of hangul syllable Unicode code point: U+AC01 Hangul(한글) ‘각’ jamo(자모/字母): ‘ᄀ’ plus ‘ᅡ’ plus ‘ᆨ’ choseong(초성/初聲):ㄱ (codepoint: U+1100) jungseong(중성/中聲):ㅏ(codepoint: U+1161) jongseong(종성/終聲):ᆨ (codepoint: U+11A8) Change-Id: I9ad14ce14a2168a4c3ac4e7cb6c7e5cfbaad39ad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97344 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svtools')
-rwxr-xr-x[-rw-r--r--]svtools/source/misc/sampletext.cxx15
1 files changed, 14 insertions, 1 deletions
diff --git a/svtools/source/misc/sampletext.cxx b/svtools/source/misc/sampletext.cxx
index a08c2867abfc..b87c1250a4eb 100644..100755
--- a/svtools/source/misc/sampletext.cxx
+++ b/svtools/source/misc/sampletext.cxx
@@ -100,7 +100,18 @@ static UScriptCode lcl_getHardCodedScriptNameForFont (const OutputDevice &rDevic
// These fonts claim support for ARMENIAN and a bunch of other stuff they don't support
return USCRIPT_SIMPLIFIED_HAN;
}
-
+ else if (rName.startsWith("Noto")) {
+ // These fonts claim support for CJK(Chinese-Japanese-Korean) languages.
+ if (rName.indexOf(" KR") > 0 || rName.indexOf("Korean") > 0) {
+ return USCRIPT_KOREAN;
+ } else if (rName.indexOf(" JP") > 0 || rName.indexOf("Japanese") > 0) {
+ return USCRIPT_JAPANESE;
+ } else if (rName.indexOf(" SC") > 0 || rName.indexOf("S Chinese") > 0) {
+ return USCRIPT_SIMPLIFIED_HAN;
+ } else if (rName.indexOf(" TC") > 0 || rName.indexOf(" HK") > 0 || rName.indexOf("T Chinese") > 0) {
+ return USCRIPT_TRADITIONAL_HAN;
+ }
+ }
return USCRIPT_INVALID_CODE;
}
@@ -361,6 +372,7 @@ OUString makeShortRepresentativeTextForScript(UScriptCode eScript)
sSampleText = OUString(aGeorgian, SAL_N_ELEMENTS(aGeorgian));
break;
}
+ case USCRIPT_JAMO:
case USCRIPT_HANGUL:
case USCRIPT_KOREAN:
{
@@ -555,6 +567,7 @@ static OUString makeRepresentativeTextForScript(UScriptCode eScript)
sSampleText = OUString(aJa, SAL_N_ELEMENTS(aJa));
break;
}
+ case USCRIPT_JAMO:
case USCRIPT_KOREAN:
case USCRIPT_HANGUL:
{