Katakana is not recognized as Japanese or CJK

I tried the latest versions of TeXmacs and Mogan STEM on Windows 11, and the developing version of TeXmacs on WSL. When I set the language to Japanese and started typing, kanji and hiragana were rendered in Mincho style (same font), while katakana appeared in Gothic style (a different font). Furthermore, in the beamer template, katakana appeared smaller than kanji and hiragana.

Looking into the source code, I found the following section in smart_font.cpp

string
get_unicode_range (int code) {
  if (code <= 0x7f) return "ascii";
  else if (code >= 0x80 && code <= 0x37f) return "latin";
  else if (code >= 0x380 && code <= 0x3ff) return "greek";
  else if (code >= 0x400 && code <= 0x4ff) return "cyrillic";
  else if (code >= 0x3000 && code <= 0x303f) return "cjk";
  else if (code >= 0x4e00 && code <= 0x9fcc) return "cjk";
  else if (code >= 0xff00 && code <= 0xffef) return "cjk";
  else if (code >= 0x3040 && code <= 0x309F) return "hiragana";
  else if (code >= 0xac00 && code <= 0xd7af) return "hangul";
  else if (code >= 0x2000 && code <= 0x23ff) return "mathsymbols";
  else if (code >= 0x2900 && code <= 0x2e7f) return "mathextra";
  else if (code >= 0x1d400 && code <= 0x1d7ff) return "mathletters";
  else return "";
}

The Unicode range for katakana is 0x30A0–0x30FF, but it doesn’t seem to be included anywhere. Is there a particular reason for this design?

Can you provide a simple document witnessing the problem? It might be useful to correct the bug. Eventually if you like you can post yourself a bug in TeXmacs’ bug-tracker here: https://savannah.gnu.org/bugs/?group=texmacs

Dear @mgubi, thank you for your reply.

Sorry for the late response. I have found a solution and would like to share some examples.

In conclusion, while the general fallback is a partial solution, it would be better if the CJK range assignment also included katakana in addition to kanji and hiragana.

1 Like