private Atom ConvertCharacter(TexFormula formula, string value, ref int position, char character) { position++; var font = TexUtility.RenderFont == -2 ? TexUtility.RawRenderFont : TexUtility.RenderFont; if (font == -1 && IsSymbol(character)) { // Character is symbol (and math). var charIdx = TEXPreference.main.charMapData[character, -1]; if (charIdx >= 0) { return(SymbolAtom.Get(TEXPreference.main.GetChar(charIdx), character)); } return(UnicodeAtom.Get(TEXConfiguration.main.Typeface_Unicode, character)); } else { // Character is alpha-numeric. if (font >= 0 && !TEXPreference.main.IsCharAvailable(font, character)) { return(UnicodeAtom.Get(font, character)); } return(CharAtom.Get(character)); } }
private Atom ConvertCharacter(string value, ref int position, char character) { position++; var font = TexContext.Font.value; if (font == -1) { // Character is symbol (and math). var charIdx = TEXPreference.main.charmaps[character, -1]; if (charIdx >= 0) { return(SymbolAtom.Get(TEXPreference.main.GetChar(charIdx), character)); } else { return(CharAtom.Get(character, -1)); } } else { return(CharAtom.Get(character, font)); } }