Font Cascadia vs Consolas

By Xah Lee. Date: . Last updated: .
font Consolas 2026-11-17 22eca L font Cascadia Mono 2026-11-17 22ed2 L

Code

/* return the hexadecimal string of the char's utf16 encoding.
string is separated by space for each char */
const f_charID_to_utf16_hexStr = (CharID: number): string => {
  const xCharStr = String.fromCodePoint(CharID);
  if (CharID < 2 ** 16) {
    return xCharStr.charCodeAt(0).toString(16).toUpperCase();
  } else {
    const xLen = String.fromCodePoint(CharID).length;
    const xResultArray = [];
    for (let i = 0; i < xLen; i++) {
      xResultArray.push(xCharStr.charCodeAt(i).toString(16).toUpperCase());
    }
    return xResultArray.join(" ");
  }
};