Home | History | Annotate | Download | only in fpdf_font

Lines Matching defs:charcode

163 void CPDF_Font::AppendChar(CFX_ByteString& str, FX_DWORD charcode) const
166 int len = AppendChar(buf, charcode);
173 CFX_WideString CPDF_Font::UnicodeFromCharCode(FX_DWORD charcode) const
179 CFX_WideString wsRet = m_pToUnicodeMap->Lookup(charcode);
184 FX_WCHAR unicode = _UnicodeFromCharCode(charcode);
196 FX_DWORD charcode = m_pToUnicodeMap->ReverseLookup(unicode);
197 if (charcode) {
198 return charcode;
211 FX_DWORD charcode = GetNextChar(src_buf, src_len, src_pos);
212 CFX_WideString unicode = UnicodeFromCharCode(charcode);
216 result += (FX_WCHAR)charcode;
229 FX_DWORD charcode = CharCodeFromUnicode(src_buf[src_pos]);
230 dest_pos += AppendChar(dest_buf + dest_pos, charcode);
377 FX_DWORD charcode = GetNextChar(pString, size, offset);
378 width += GetCharWidthF(charcode);
382 int CPDF_Font::GetCharTypeWidth(FX_DWORD charcode)
387 int glyph_index = GlyphFromCharCode(charcode);
495 CFX_WideString CPDF_ToUnicodeMap::Lookup(FX_DWORD charcode)
498 if (m_Map.Lookup(charcode, value)) {
519 return m_pBaseMap->UnicodeFromCID((FX_WORD)charcode);
819 extern FX_LPCSTR PDF_CharNameFromPredefinedCharSet(int encoding, FX_BYTE charcode);
833 int CPDF_SimpleFont::GlyphFromCharCode(FX_DWORD charcode, FX_BOOL *pVertGlyph)
838 if (charcode > 0xff) {
841 int index = m_GlyphIndex[(FX_BYTE)charcode];
847 void CPDF_SimpleFont::LoadCharMetrics(int charcode)
852 if (charcode < 0 || charcode > 0xff) {
855 int glyph_index = m_GlyphIndex[charcode];
857 if (m_pFontFile == NULL && charcode != 32) {
859 m_CharBBox[charcode] = m_CharBBox[32];
861 m_CharWidth[charcode] = m_CharWidth[32];
870 m_CharBBox[charcode].Left = TT2PDF(FXFT_Get_Glyph_HoriBearingX(m_Font.m_Face), m_Font.m_Face);
871 m_CharBBox[charcode].Right = TT2PDF(FXFT_Get_Glyph_HoriBearingX(m_Font.m_Face) + FXFT_Get_Glyph_Width(m_Font.m_Face), m_Font.m_Face);
872 m_CharBBox[charcode].Top = TT2PDF(FXFT_Get_Glyph_HoriBearingY(m_Font.m_Face), m_Font.m_Face);
873 m_CharBBox[charcode].Bottom = TT2PDF(FXFT_Get_Glyph_HoriBearingY(m_Font.m_Face) - FXFT_Get_Glyph_Height(m_Font.m_Face), m_Font.m_Face);
876 if (m_CharWidth[charcode] == 0xffff) {
877 m_CharWidth[charcode] = TT_Width;
879 m_CharBBox[charcode].Right = m_CharBBox[charcode].Right * m_CharWidth[charcode] / TT_Width;
880 m_CharBBox[charcode].Left = m_CharBBox[charcode].Left * m_CharWidth[charcode] / TT_Width;
884 int CPDF_SimpleFont::GetCharWidthF(FX_DWORD charcode, int level)
886 if (charcode > 0xff) {
887 charcode = 0;
889 if (m_CharWidth[charcode] == 0xffff) {
890 LoadCharMetrics(charcode);
891 if (m_CharWidth[charcode] == 0xffff) {
892 m_CharWidth[charcode] = 0;
895 return (FX_INT16)m_CharWidth[charcode];
897 void CPDF_SimpleFont::GetCharBBox(FX_DWORD charcode, FX_RECT& rect, int level)
899 if (charcode > 0xff) {
900 charcode = 0;
902 if (m_CharBBox[charcode].Left == (FX_SHORT)0xffff) {
903 LoadCharMetrics(charcode);
905 rect.left = m_CharBBox[charcode].Left;
906 rect.right = m_CharBBox[charcode].Right;
907 rect.bottom = m_CharBBox[charcode].Bottom;
908 rect.top = m_CharBBox[charcode].Top;
910 FX_LPCSTR GetAdobeCharName(int iBaseEncoding, const CFX_ByteString* pCharNames, int charcode)
912 ASSERT(charcode >= 0 && charcode < 256);
913 if (charcode < 0 || charcode >= 256) {
918 name = pCharNames[charcode];
921 name = PDF_CharNameFromPredefinedCharSet(iBaseEncoding, charcode);
1067 extern FX_WCHAR FT_UnicodeFromCharCode(int encoding, FX_DWORD charcode);
1071 int CPDF_Type1Font::GlyphFromCharCodeExt(FX_DWORD charcode)
1073 if (charcode > 0xff) {
1076 int index = m_ExtGID[(FX_BYTE)charcode];
1132 for (int charcode = 0; charcode < 256; charcode ++) {
1135 FX_WORD unicode = prefix[j] * 256 + charcode;
1136 m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, unicode);
1139 FXFT_Get_Glyph_Name(m_Font.m_Face, m_GlyphIndex[charcode], name_glyph, 256);
1142 m_ExtGID[charcode] = CGFontGetGlyphWithGlyphName((CGFontRef)m_Font.m_pPlatformFont, name_ct);
1147 if (m_GlyphIndex[charcode]) {
1166 for (int charcode = 0; charcode < 256; charcode ++) {
1167 FX_LPCSTR name = GetAdobeCharName(m_BaseEncoding, m_pCharNames, charcode);
1171 m_Encoding.m_Unicodes[charcode] = PDF_UnicodeFromAdobeName(name);
1172 m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, m_Encoding.m_Unicodes[charcode]);
1175 FXFT_Get_Glyph_Name(m_Font.m_Face, m_GlyphIndex[charcode], name_glyph, 256);
1178 m_ExtGID[charcode] = CGFontGetGlyphWithGlyphName((CGFontRef)m_Font.m_pPlatformFont, name_ct);
1183 if (m_GlyphIndex[charcode] == 0 && FXSYS_strcmp(name, ".notdef") == 0) {
1184 m_Encoding.m_Unicodes[charcode] = 0x20;
1185 m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, 0x20);
1188 FXFT_Get_Glyph_Name(m_Font.m_Face, m_GlyphIndex[charcode], name_glyph, 256);
1191 m_ExtGID[charcode] = CGFontGetGlyphWithGlyphName((CGFontRef)m_Font.m_pPlatformFont, name_ct);
1209 for (int charcode = 0; charcode < 256; charcode ++) {
1210 FX_LPCSTR name = GetAdobeCharName(m_BaseEncoding, m_pCharNames, charcode);
1212 m_Encoding.m_Unicodes[charcode] = PDF_UnicodeFromAdobeName(name);
1213 m_GlyphIndex[charcode] = FXFT_Get_Name_Index(m_Font.m_Face, (char*)name);
1215 m_ExtGID[charcode] = CGFontGetGlyphWithGlyphName((CGFontRef)m_Font.m_pPlatformFont, name_ct);
1220 m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, charcode);
1222 if (m_GlyphIndex[charcode]) {
1223 unicode = FT_UnicodeFromCharCode(PDFFONT_ENCODING_STANDARD, charcode);
1227 FXFT_Get_Glyph_Name(m_Font.m_Face, m_GlyphIndex[charcode], name_glyph, 256);
1232 m_Encoding.m_Unicodes[charcode] = unicode;
1234 m_ExtGID[charcode] = CGFontGetGlyphWithGlyphName((CGFontRef)m_Font.m_pPlatformFont, name_ct);
1246 for (int charcode = 0; charcode < 256; charcode ++) {
1247 FX_LPCSTR name = GetAdobeCharName(m_BaseEncoding, m_pCharNames, charcode);
1251 m_Encoding.m_Unicodes[charcode] = PDF_UnicodeFromAdobeName(name);
1256 m_GlyphIndex[charcode] = FXFT_Get_Name_Index(m_Font.m_Face, (char*)name);
1258 m_ExtGID[charcode] = CGFontGetGlyphWithGlyphName((CGFontRef)m_Font.m_pPlatformFont, name_ct);
1262 if (m_GlyphIndex[charcode] == 0) {
1264 m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, bUnicode ? m_Encoding.m_Unicodes[charcode] : charcode);
1266 FXFT_Get_Glyph_Name(m_Font.m_Face, m_GlyphIndex[charcode], name_glyph, 256);
1269 m_ExtGID[charcode] = CGFontGetGlyphWithGlyphName((CGFontRef)m_Font.m_pPlatformFont, name_ct);
1274 m_Encoding.m_Unicodes[charcode] = 0x20;
1275 m_GlyphIndex[charcode] = bUnicode ? FXFT_Get_Char_Index(m_Font.m_Face, 0x20) : 0xffff;
1277 FXFT_Get_Glyph_Name(m_Font.m_Face, m_GlyphIndex[charcode], name_glyph, 256);
1280 m_ExtGID[charcode] = CGFontGetGlyphWithGlyphName((CGFontRef)m_Font.m_pPlatformFont, name_ct);
1291 for (int charcode = 0; charcode < 256; charcode ++) {
1292 FX_LPCSTR name = GetAdobeCharName(m_BaseEncoding, m_pCharNames, charcode);
1294 m_Encoding.m_Unicodes[charcode] = PDF_UnicodeFromAdobeName(name);
1295 m_GlyphIndex[charcode] = FXFT_Get_Name_Index(m_Font.m_Face, (char*)name);
1297 m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, charcode);
1298 if (m_GlyphIndex[charcode]) {
1299 FX_WCHAR unicode = FT_UnicodeFromCharCode(PDFFONT_ENCODING_STANDARD, charcode);
1303 FXFT_Get_Glyph_Name(m_Font.m_Face, m_GlyphIndex[charcode], name_glyph, 256);
1309 m_Encoding.m_Unicodes[charcode] = unicode;
1324 for (int charcode = 0; charcode < 256; charcode ++) {
1325 FX_LPCSTR name = GetAdobeCharName(m_BaseEncoding, m_pCharNames, charcode);
1329 m_Encoding.m_Unicodes[charcode] = PDF_UnicodeFromAdobeName(name);
1330 m_GlyphIndex[charcode] = FXFT_Get_Name_Index(m_Font.m_Face, (char*)name);
1331 if (m_GlyphIndex[charcode] == 0) {
1333 m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, bUnicode ? m_Encoding.m_Unicodes[charcode] : charcode);
1335 m_Encoding.m_Unicodes[charcode] = 0x20;
1336 m_GlyphIndex[charcode] = 0xffff;
1455 int charcode = 0;
1456 for (; charcode < nStartChar; charcode ++) {
1457 m_GlyphIndex[charcode] = 0;
1459 FX_WORD nGlyph = charcode - nStartChar + 3;
1460 for (; charcode < 256; charcode ++, nGlyph ++) {
1461 m_GlyphIndex[charcode] = nGlyph;
1477 for (int charcode = 0; charcode < 256; charcode ++) {
1478 FX_LPCSTR name = GetAdobeCharName(baseEncoding, m_pCharNames, charcode);
1480 m_GlyphIndex[charcode] = m_pFontFile ? FXFT_Get_Char_Index(m_Font.m_Face, charcode) : -1;
1483 m_Encoding.m_Unicodes[charcode] = PDF_UnicodeFromAdobeName(name);
1487 FX_WORD unicode = prefix[j] * 256 + charcode;
1488 m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, unicode);
1489 if (m_GlyphIndex[charcode]) {
1493 } else if (m_Encoding.m_Unicodes[charcode]) {
1495 m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, m_Encoding.m_Unicodes[charcode]);
1497 FX_DWORD maccode = FT_CharCodeFromUnicode(FXFT_ENCODING_APPLE_ROMAN, m_Encoding.m_Unicodes[charcode]);
1499 m_GlyphIndex[charcode] = FXFT_Get_Name_Index(m_Font.m_Face, (char *)name);
1501 m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, maccode);
1505 if ((m_GlyphIndex[charcode] == 0 || m_GlyphIndex[charcode] == 0xffff) && name != NULL) {
1507 m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, 32);
1509 m_GlyphIndex[charcode] = FXFT_Get_Name_Index(m_Font.m_Face, (char*)name);
1510 if (m_GlyphIndex[charcode] == 0) {
1512 CFX_WideString wsUnicode = UnicodeFromCharCode(charcode);
1514 m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, wsUnicode[0]);
1515 m_Encoding.m_Unicodes[charcode] = wsUnicode[0];
1518 if (m_GlyphIndex[charcode] == 0) {
1519 m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, charcode);
1530 for (int charcode = 0; charcode < 256; charcode ++) {
1532 FX_WORD unicode = prefix[j] * 256 + charcode;
1533 m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, unicode);
1534 if (m_GlyphIndex[charcode]) {
1542 for (int charcode = 0; charcode < 256; charcode ++) {
1543 FX_LPCSTR name = GetAdobeCharName(baseEncoding, m_pCharNames, charcode);
1547 m_Encoding.m_Unicodes[charcode] = PDF_UnicodeFromAdobeName(name);
1550 for (int charcode = 0; charcode < 256; charcode ++) {
1551 m_Encoding.m_Unicodes[charcode] = FT_UnicodeFromCharCode(FXFT_ENCODING_APPLE_ROMAN, charcode);
1559 for (int charcode = 0; charcode < 256; charcode ++) {
1560 m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, charcode);
1561 m_Encoding.m_Unicodes[charcode] = FT_UnicodeFromCharCode(FXFT_ENCODING_APPLE_ROMAN, charcode);
1562 if (m_GlyphIndex[charcode]) {
1573 for (int charcode = 0; charcode < 256; charcode ++) {
1575 FX_LPCSTR name = GetAdobeCharName(0, m_pCharNames, charcode);
1577 m_Encoding.m_Unicodes[charcode] = PDF_UnicodeFromAdobeName(name);
1579 m_Encoding.m_Unicodes[charcode] = pUnicodes[charcode];
1582 m_Encoding.m_Unicodes[charcode] = charcode;
1584 m_GlyphIndex[charcode] = FXFT_Get_Char_Index(m_Font.m_Face, m_Encoding.m_Unicodes[charcode]);
1585 if (m_GlyphIndex[charcode]) {
1593 for (int charcode = 0; charcode < 256; charcode ++) {
1594 m_GlyphIndex[charcode] = charcode;
1668 CPDF_Type3Char* CPDF_Type3Font::LoadChar(FX_DWORD charcode, int level)
1674 if (m_CacheMap.Lookup((FX_LPVOID)(FX_UINTPTR)charcode, (FX_LPVOID&)pChar)) {
1677 m_CacheMap.RemoveKey((FX_LPVOID)(FX_UINTPTR)charcode);
1678 return LoadChar(charcode, level + 1);
1682 FX_LPCSTR name = GetAdobeCharName(m_BaseEncoding, m_pCharNames, charcode);
1706 m_CacheMap.SetAt((FX_LPVOID)(FX_UINTPTR)charcode, pChar);
1713 int CPDF_Type3Font::GetCharWidthF(FX_DWORD charcode, int level)
1715 if (charcode > 0xff) {
1716 charcode = 0;
1718 if (m_CharWidthL[charcode]) {
1719 return m_CharWidthL[charcode];
1721 CPDF_Type3Char* pChar = LoadChar(charcode, level);
1727 void CPDF_Type3Font::GetCharBBox(FX_DWORD charcode, FX_RECT& rect, int level)
1729 CPDF_Type3Char* pChar = LoadChar(charcode, level);