@@ 433-447 (lines=15) @@ | ||
430 | // get the offsets to the locations of the glyphs in the font, relative to the beginning of the glyphData table |
|
431 | $indexToLoc = array(); |
|
432 | $offset = $table['loca']['offset']; |
|
433 | if ($short_offset) { |
|
434 | // short version |
|
435 | $tot_num_glyphs = floor($table['loca']['length'] / 2); // numGlyphs + 1 |
|
436 | for ($i = 0; $i < $tot_num_glyphs; ++$i) { |
|
437 | $indexToLoc[$i] = TCPDF_STATIC::_getUSHORT($font, $offset) * 2; |
|
438 | $offset += 2; |
|
439 | } |
|
440 | } else { |
|
441 | // long version |
|
442 | $tot_num_glyphs = floor($table['loca']['length'] / 4); // numGlyphs + 1 |
|
443 | for ($i = 0; $i < $tot_num_glyphs; ++$i) { |
|
444 | $indexToLoc[$i] = TCPDF_STATIC::_getULONG($font, $offset); |
|
445 | $offset += 4; |
|
446 | } |
|
447 | } |
|
448 | // get glyphs indexes of chars from cmap table |
|
449 | $offset = $table['cmap']['offset'] + 2; |
|
450 | $numEncodingTables = TCPDF_STATIC::_getUSHORT($font, $offset); |
|
@@ 986-1000 (lines=15) @@ | ||
983 | // get the offsets to the locations of the glyphs in the font, relative to the beginning of the glyphData table |
|
984 | $indexToLoc = array(); |
|
985 | $offset = $table['loca']['offset']; |
|
986 | if ($short_offset) { |
|
987 | // short version |
|
988 | $tot_num_glyphs = floor($table['loca']['length'] / 2); // numGlyphs + 1 |
|
989 | for ($i = 0; $i < $tot_num_glyphs; ++$i) { |
|
990 | $indexToLoc[$i] = TCPDF_STATIC::_getUSHORT($font, $offset) * 2; |
|
991 | $offset += 2; |
|
992 | } |
|
993 | } else { |
|
994 | // long version |
|
995 | $tot_num_glyphs = ($table['loca']['length'] / 4); // numGlyphs + 1 |
|
996 | for ($i = 0; $i < $tot_num_glyphs; ++$i) { |
|
997 | $indexToLoc[$i] = TCPDF_STATIC::_getULONG($font, $offset); |
|
998 | $offset += 4; |
|
999 | } |
|
1000 | } |
|
1001 | // get glyphs indexes of chars from cmap table |
|
1002 | $subsetglyphs = array(); // glyph IDs on key |
|
1003 | $subsetglyphs[0] = true; // character codes that do not correspond to any glyph in the font should be mapped to glyph index 0 |