MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / getASCIISubstitution

Function getASCIISubstitution

modules/commodetto/cfeBMF.c:600–621  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

598};
599
600const char *getASCIISubstitution(uint32_t cp)
601{
602 if ((0x00A0 <= cp) && (cp <= 0x00FF)) {
603 const char *base = kLatin1Base[cp - 0x00A0];
604 if (base[0])
605 return base;
606 }
607
608 size_t lo = 0, hi = (sizeof(TABLE) / sizeof(TABLE[0]));
609
610 while (lo < hi) {
611 size_t mid = lo + ((hi - lo) >> 1);
612 if (TABLE[mid].codepoint < cp)
613 lo = mid + 1;
614 else if (TABLE[mid].codepoint > cp)
615 hi = mid;
616 else
617 return TABLE[mid].ascii;
618 }
619
620 return C_NULL;
621}

Callers 1

CFEGetGlyphFromUnicodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected