Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions core/include/ldml/keyman_core_ldml.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
#pragma once

#define LDML_BKSP_FLAGS_ERROR 0x1
#define LDML_CLDR_IMPLIED_FORMS_IMPORT "46/scanCodes-implied.xml"
#define LDML_CLDR_IMPLIED_KEYS_IMPORT "46/keys-Latn-implied.xml"
#define LDML_CLDR_IMPLIED_FORMS_IMPORT "49/scanCodes-implied.xml"
#define LDML_CLDR_IMPLIED_KEYS_IMPORT "49/keys-Latn-implied.xml"
#define LDML_CLDR_IMPORT_BASE "cldr"
#define LDML_CLDR_TEST_VERSION_LATEST "techpreview"
#define LDML_CLDR_VERSION_LATEST "46"
#define LDML_CLDR_VERSION_LATEST "49"
#define LDML_ELEM_FLAGS_ORDER_BITSHIFT 0x10
#define LDML_ELEM_FLAGS_ORDER_MASK 0xFF0000
#define LDML_ELEM_FLAGS_PREBASE 0x8
Expand Down
6 changes: 3 additions & 3 deletions core/include/ldml/keyman_core_ldml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class Constants {
/**
* The current CLDR version
*/
readonly cldr_version_latest = '46';
readonly cldr_version_latest = '49';
/**
* The version for testdata files
*/
Expand Down Expand Up @@ -582,8 +582,8 @@ class Constants {
}
};

/** There's no data or DTD change in 45, 46, 46.1, 47 so map them all to 46 at present. */
const cldrTreatAsLatest: Set<string> = new Set(['45', '46.1', '47']);
/** There's no incompatible DTD change in 45+ so map them all to current at present. */
const cldrTreatAsLatest: Set<string> = new Set(['45', '46.1', '47', '48', '48.1', '48.2', '48.3', '49']);

export const constants = new Constants();

Expand Down
16 changes: 8 additions & 8 deletions core/src/kmx/kmx_xstring.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ const km_core_usv Uni_MAX_CODEPOINT = 0x10FFFF;
* @brief True if a lead surrogate
* \def Uni_IsSurrogate1
*/
#define Uni_IsSurrogate1(ch) ((ch) >= km::core::kmx::Uni_LEAD_SURROGATE_START && (ch) <= km::core::kmx::Uni_LEAD_SURROGATE_END)
#define Uni_IsSurrogate1(ch) ((km_core_usv)(ch) >= (km_core_usv)km::core::kmx::Uni_LEAD_SURROGATE_START && (km_core_usv)(ch) <= (km_core_usv)km::core::kmx::Uni_LEAD_SURROGATE_END)
/**
* @brief True if a trail surrogate
* \def Uni_IsSurrogate2
*/
#define Uni_IsSurrogate2(ch) ((ch) >= km::core::kmx::Uni_TRAIL_SURROGATE_START && (ch) <= km::core::kmx::Uni_TRAIL_SURROGATE_END)
#define Uni_IsSurrogate2(ch) ((km_core_usv)(ch) >= (km_core_usv)km::core::kmx::Uni_TRAIL_SURROGATE_START && (km_core_usv)(ch) <= (km_core_usv)km::core::kmx::Uni_TRAIL_SURROGATE_END)

/**
* @brief True if any surrogate
Expand All @@ -42,15 +42,15 @@ const km_core_usv Uni_MAX_CODEPOINT = 0x10FFFF;
* @brief Returns true if BMP (Plane 0)
* \def Uni_IsBMP
*/
#define Uni_IsBMP(ch) ((ch) <= km::core::kmx::Uni_BMP_END)
#define Uni_IsBMP(ch) ((km_core_usv)(ch) <= (km_core_usv)km::core::kmx::Uni_BMP_END)

/**
* @brief Convert two UTF-16 surrogates into one UTF-32 codepoint
* @param ch lead surrogate - Uni_IsSurrogate1(ch) must == true
* @param cl trail surrogate - Uni_IsSurrogate2(cl) must == true
* \def Uni_SurrogateToUTF
*/
#define Uni_SurrogateToUTF32(ch, cl) (((ch) - km::core::kmx::Uni_LEAD_SURROGATE_START) * 0x400 + ((cl) - km::core::kmx::Uni_TRAIL_SURROGATE_START) + km::core::kmx::Uni_SMP_START)
#define Uni_SurrogateToUTF32(ch, cl) (((km_core_usv)(ch) - (km_core_usv)km::core::kmx::Uni_LEAD_SURROGATE_START) * 0x400 + ((km_core_usv)(cl) - (km_core_usv)km::core::kmx::Uni_TRAIL_SURROGATE_START) + (km_core_usv)km::core::kmx::Uni_SMP_START)

/**
* @brief Convert UTF-32 BMP to UTF-16 BMP
Expand Down Expand Up @@ -189,7 +189,7 @@ u32string_to_u16string(const std::u32string &source) {
}

inline bool Uni_IsEndOfPlaneNonCharacter(km_core_usv ch) {
return (((ch) & Uni_FFFE_NONCHARACTER) == Uni_FFFE_NONCHARACTER); // matches FFFF or FFFE
return (((ch) & (km_core_usv)Uni_FFFE_NONCHARACTER) == (km_core_usv)Uni_FFFE_NONCHARACTER); // matches FFFF or FFFE
}

inline bool Uni_IsNoncharacter(km_core_usv ch) {
Expand All @@ -208,13 +208,13 @@ inline bool Uni_IsValid(km_core_usv start, km_core_usv end) {
if (!Uni_IsValid(end) || !Uni_IsValid(start) || (end < start)) {
// start or end out of range, or inverted range
return false;
} else if ((start <= Uni_SURROGATE_END) && (end >= Uni_SURROGATE_START)) {
} else if ((start <= (km_core_usv)Uni_SURROGATE_END) && (end >= (km_core_usv)Uni_SURROGATE_START)) {
// contains some of the surrogate range
return false;
} else if ((start <= Uni_FD_NONCHARACTER_END) && (end >= Uni_FD_NONCHARACTER_START)) {
} else if ((start <= (km_core_usv)Uni_FD_NONCHARACTER_END) && (end >= (km_core_usv)Uni_FD_NONCHARACTER_START)) {
// contains some of the noncharacter range
return false;
} else if ((start & Uni_PLANE_MASK) != (end & Uni_PLANE_MASK)) {
} else if ((start & (km_core_usv)Uni_PLANE_MASK) != (end & (km_core_usv)Uni_PLANE_MASK)) {
// start and end are on different planes, meaning that the U+__FFFE/U+__FFFF noncharacters
// are contained.
// As a reminder, we already checked that start/end are themselves valid,
Expand Down
6 changes: 3 additions & 3 deletions core/subprojects/icu-minimal.wrap
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[wrap-file]
directory = icu
source_url = https://github.com/unicode-org/icu/releases/download/release-73-1/icu4c-73_1-src.tgz
source_filename = icu4c-73_1-src.tgz
source_hash = a457431de164b4aa7eca00ed134d00dfbf88a77c6986a10ae7774fc076bb8c45
source_url = https://github.com/unicode-org/icu/releases/download/release-77-1/icu4c-77_1-src.tgz
source_filename = icu4c-77_1-src.tgz
source_hash = 3a2e7a47604ba702f345878308e6fefeca612ee895cf4a5f222e7955fabfe0c0
## TODO-LDML: Note, need meson 0.55.0 to use patch_directory
patch_directory = icu

Expand Down
2 changes: 1 addition & 1 deletion core/subprojects/packagefiles/icu/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ project(
'icu',
'c',
'cpp',
version: '73.1',
version: '77.1',
meson_version: '>=0.57.0', # TODO-LDML: Too high for debian
default_options: [ 'cpp_std=c++17' ],
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface LDMLKeyboardXMLSourceFile {
export interface LKKeyboard {
locale?: string;
conformsTo?: string;
draft?: string;

locales?: LKLocales;
version?: LKVersion;
Expand Down Expand Up @@ -62,6 +63,8 @@ export interface LKInfo {
author?: string;
layout?: string;
indicator?: string;
attribution?: string;
draft?: string;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
draft?: string;

draft is on keyboard3, not on info?

};

export interface LKSettings {
Expand Down
6 changes: 6 additions & 0 deletions developer/src/kmc-ldml/src/compiler/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ export class MetaCompiler extends SectionCompiler {
{compileContext: this.keyboard3.version});
result.settings =
(this.keyboard3.settings?.normalization == "disabled" ? KeyboardSettings.normalizationDisabled : 0);
if (this.keyboard3.info?.attribution) {
this.callbacks.debug(`meta: Ignored value attribution=${this.keyboard3.info?.attribution}`);
}
if (this.keyboard3.draft) {
this.callbacks.debug(`meta: Ignored value draft=${this.keyboard3.draft}`);
}
return result;
}
}
173 changes: 173 additions & 0 deletions resources/standards-data/ldml-keyboards/49/3.0/bn.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Note: conformsTo= references a previous release here,
because this keyboard does not depend on schema or data from later CLDR versions.
-->
<keyboard3 xmlns="https://schemas.unicode.org/cldr/45/keyboard3" locale="bn" conformsTo="45">
<!--
History:
Based on
https://github.com/keymanapp/ldml-keyboards-dev/blob/master/keyboards/sil-bengali/bn-t-k0-cldr-phonetic.ldml
-->
<locales>
<locale id="as" />
<locale id="syl" />
</locales>
<version number="1.3.0" />
<info name="SIL Bengali-Assamese Phonetic" indicator="bn" layout="QWERTY" />

<displays>
<display keyId="au-lengthener" display="ৗ" />
<display keyId="vis-hasant" display="্" /> <!-- TODO: distinguish from regular hasant? -->
<display keyId="more" display="…" />
</displays>

<keys>
<import base="cldr" path="45/keys-Zyyy-punctuation.xml" />
<import base="cldr" path="45/keys-Zyyy-currency.xml" />

<key id="1" output="১" />
<key id="2" output="২" />
<key id="3" output="৩" />
<key id="4" output="৪" />
<key id="5" output="৫" />
<key id="6" output="৬" />
<key id="7" output="৭" />
<key id="8" output="৮" />
<key id="9" output="৯" />
<key id="0" output="০" />

<!-- special keys and marks -->
<key id="au-lengthener" output="\m{A}" />
<key id="candrabindu" output="\u{0981}" /> <!-- n̐ -->
<key id="hasant" output="\u{09CD}" />
<key id="more" output="\m{q}" /> <!-- 'additional characters' -->
<key id="nukta" output="\u{09BC}" />
<key id="vis-hasant" output="\m{X}" />

<!-- key names based on https://www.loc.gov/catdir/cpso/romanization/bengali.pdf + Assamese for /wa/ -->
<key id="ā" output="\u{09BE}" />
<key id="ai" output="\u{09C8}" />
<key id="au" output="\u{09CC}" />
<key id="ba" output="ব" />
<key id="bha" output="ভ" />
<key id="ca" output="চ" />
<key id="cha" output="ছ" />
<key id="ḍa" output="ড" />
<key id="da" output="দ" />
<key id="dahri" output="।" />
<key id="ḍha" output="ঢ" />
<key id="dha" output="ধ" />
<key id="e" output="\u{09C7}" />
<key id="ga" output="গ" />
<key id="gha" output="ঘ" />
<key id="ha" output="হ" />
<key id="i" output="\u{09BF}" />
<key id="ī" output="\u{09C0}" />
<key id="ja" output="জ" />
<key id="jha" output="ঝ" />
<key id="ka" output="ক" />
<key id="kha" output="খ" />
<key id="la" output="ল" />
<key id="ṃ" output="\u{0982}" />
<key id="ma" output="ম" />
<key id="ṅa" output="ঙ" />
<key id="ña" output="ঞ" />
<key id="ṇa" output="ণ" />
<key id="na" output="ন" />
<key id="o" output="\u{09CB}" />
<key id="pa" output="প" />
<key id="pha" output="ফ" />
<key id="ṛ" output="\u{09C3}" />
<key id="ra" output="র" />
<key id="śa" output="শ" />
<key id="sa" output="স" />
<key id="sha" output="ষ" />
<key id="ṭa" output="ট" />
<key id="ta" output="ত" />
<key id="ṭha" output="ঠ" />
<key id="tha" output="থ" />
<key id="u" output="\u{09C1}" />
<key id="ū" output="\u{09C2}" />
<key id="wa" output="ৱ" /> <!-- Assamese transliteration -->
<key id="ya" output="য" />
<key id="ẏa" output="য়" /> <!-- Missing in Keyman version of file-->
</keys>
<layers formId="us">
<layer modifiers="none">
<row keys="candrabindu 1 2 3 4 5 6 7 8 9 0 hyphen equal" />
<row keys="more wa e ra ta ya u i o pa open-square close-square backslash" />
<row keys="ā sa da ṭa ga ha ja ka la semi-colon apos" />
<row keys="śa hasant ca ḍa ba na ma comma dahri slash" />
<row keys="space" />
</layer>
<layer modifiers="shift">
<row
keys="ṃ bang at hash dollar percent caret amp asterisk open-paren close-paren underscore plus" />
<row keys="gap ña ai ṛ tha ẏa ū ī au pha open-curly close-curly pipe" />
<row keys="au-lengthener sha dha ṭha gha gap jha kha gap colon double-quote" />
<row keys="gap vis-hasant cha ḍha bha ṇa ṅa open-angle nukta question" />
<row keys="space" />
</layer>
</layers>

<transforms type="simple">
<transformGroup>
<transform from="\u{09C7}\m{A}" to="\u{09CC}" /> <!-- E + au-lengthener = AU -->
<!-- <transform from="\u{09C7}\u{09BE}" to="\u09CB" /> --> <!-- E + A = O This is handled by normalization. -->

<!-- these suport the 'q' key -->
<transform from="\m{q}:" to="\u{0983}" />
<transform from="\m{q}L" to="ৡ" />
<transform from="\m{q}।" to="॥" />
<transform from="\m{q}ড" to="ড়" />
<transform from="\m{q}ঢ" to="ঢ়" />
<transform from="\m{q}ত" to="ৎ" />
<transform from="\m{q}য" to="য়" />
<transform from="\m{q}র" to="ৰ" />
<transform from="\m{q}ল" to="ঌ" />
<transform from="\m{q}\u{09BE}" to="অ" />
<transform from="\m{q}\u{09BF}" to="ই" />
<transform from="\m{q}\u{09C0}" to="ঈ" />
<transform from="\m{q}\u{09C1}" to="উ" />
<transform from="\m{q}\u{09C2}" to="ঊ" />
<transform from="\m{q}\u{09C3}" to="ৠ" />
<transform from="\m{q}\u{09C7}" to="এ" />
<transform from="\m{q}\u{09C8}" to="ঐ" />
<transform from="\m{q}\u{09CB}" to="ও" />
<transform from="\m{q}\u{09CC}" to="ঔ" />
<transform from="\m{q}\m{A}" to="আ" />
<transform from="\m{q}\m{X}" to="\u{09CD}\u{200C}" /> <!-- virama + zwnj-->
</transformGroup>
<transformGroup>
<!-- Nukta is tertiary, that is, it follows a tertiaryBase sequence -->
<reorder from="\u{09BC}" tertiary="3"/>
<!--
virama (hasant) followed by any other spacing chars has order 10, because this sequence goes after the consonant to which the virama pertains.
For example:

U+099A U+09CD U+099B
CA virama CHA
0 10 10
-->
<reorder from="\u{09CD}[\u{0980}\u{0985}-\u{098C}\u{098F}\u{0990}\u{0993}-\u{09A8}\u{09AA}-\u{09B0}\u{09B2}\u{09B6}-\u{09B9}\u{09BD}\u{09DC}\u{09DD}\u{09DF}-\u{09E1}\u{09E6}-\u{09F1}\u{09FC}]" order="10" tertiaryBase="true"/>
<!-- 10: virama + zwj/zwnj + spacing mark is also 10-->
<reorder from="\u{09CD}[\u{200C}\u{200D}][\u{0980}\u{0985}-\u{098C}\u{098F}\u{0990}\u{0993}-\u{09A8}\u{09AA}-\u{09B0}\u{09B2}\u{09B6}-\u{09B9}\u{09BD}\u{09DC}\u{09DD}\u{09DF}-\u{09E1}\u{09E6}-\u{09F1}\u{09FC}]" order="10" tertiaryBase="true"/>
<!-- 120: A virama not followed by a spacing mark goes further to the right (past the sandhi mark, below) -->
<reorder from="\u{09CD}" order="120" tertiaryBase="true"/>
<!-- The next three rules make sure the DVs are in the correct order-->
<!-- 60: left side dependent vowels -->
<reorder from="[\u{09BF}\u{09C7}\u{09C8}]" order="60"/>
<!-- 70: lower dependent vowels -->
<reorder from="[\u{09C1}-\u{09C4}\u{09E2}\u{09E3}]" order="70"/>
<!-- 75: right side dependent vowels. Note U+09D7 AU LENGTH MARK is included due to NFD -->
<reorder from="[\u{09BE}\u{09C0}\u{09CB}\u{09CC}\u{09D7}]" order="75"/>
<!-- 85: candrabindu -->
<reorder from="\u{0981}" order="85"/>
<!-- 95: anusvara and visarga -->
<reorder from="[\u{0982}\u{0983}]" order="95"/>
<!-- 117: sandhi mark -->
<reorder from="\u{09FE}" order="117"/>
</transformGroup>
</transforms>
</keyboard3>
Loading
Loading