// SPDX-License-Identifier: MIT OR MPL-2.0 OR LGPL-2.1-or-later OR GPL-2.0-or-later // Copyright 2010, SIL International, All rights reserved. /* Responsibility:AlanWard Lastreviewed:Notyet.
Description: UtilityclassforhandlingTrueTypefontfiles.
*/ #pragma once
#include <cstddef>
namespace graphite2
{ namespace TtfUtil
{
#define OVERFLOW_OFFSET_CHECK(p, o) (o + reinterpret_cast<size_t>(p) < reinterpret_cast<size_t>(p))
// Enumeration used to specify a table in a TTF file class Tag
{ unsignedint _v;
public:
Tag(constchar n[5]) throw() : _v(TTF_TAG(n[0],n[1],n[2],n[3])) {}
Tag(constunsignedint tag) throw() : _v(tag) {}
////////////////////////////////// utility methods helpful for name table bool GetNameInfo(constvoid * pName, int nPlatformId, int nEncodingId, int nLangId, int nNameId, size_t & lOffset, size_t & lSize); //size_t NameTableLength(const byte * pTable); #ifdef ALL_TTFUTILS int GetLangsForNames(constvoid * pName, int nPlatformId, int nEncodingId, int *nameIdList, int cNameIds, short *langIdList); void SwapWString(void * pWStr, size_t nSize = 0); // throw (std::invalid_argument); #endif
////////////////////////////////// primitves for simple glyph data bool GlyfBox(constvoid * pSimpleGlyf, int & xMin, int & yMin, int & xMax, int & yMax);
#ifdef ALL_TTFUTILS int GlyfContourCount(constvoid * pSimpleGlyf); bool GlyfContourEndPoints(constvoid * pSimpleGlyf, int * prgnContourEndPoint, int cnPointsTotal, size_t & cnPoints); bool GlyfPoints(constvoid * pSimpleGlyf, int * prgnX, int * prgnY, char * prgbFlag, int cnPointsTotal, int & cnPoints);
// primitive to find the glyph ids in a composite glyph bool GetComponentGlyphIds(constvoid * pSimpleGlyf, int * prgnCompId,
size_t cnCompIdTotal, size_t & cnCompId); // primitive to find the placement data for a component in a composite glyph bool GetComponentPlacement(constvoid * pSimpleGlyf, int nCompId, bool fOffset, int & a, int & b); // primitive to find the transform data for a component in a composite glyph bool GetComponentTransform(constvoid * pSimpleGlyf, int nCompId, float & flt11, float & flt12, float & flt21, float & flt22, bool & fTransOffset); #endif
////////////////////////////////// operate on composite or simple glyph (auto glyf lookup) void * GlyfLookup(gid16 nGlyphId, constvoid * pGlyf, constvoid * pLoca,
size_t lGlyfSize, size_t lLocaSize, constvoid * pHead); // primitive used by below methods
#ifdef ALL_TTFUTILS // below are primary user methods for handling glyf data bool IsSpace(gid16 nGlyphId, constvoid * pLoca, size_t lLocaSize, constvoid * pHead); bool IsDeepComposite(gid16 nGlyphId, constvoid * pGlyf, constvoid * pLoca,
size_t lGlyfSize, size_t lLocaSize, constvoid * pHead);
// utitily method used by high-level GlyfPoints bool SimplifyFlags(char * prgbFlags, int cnPoints); bool CalcAbsolutePoints(int * prgnX, int * prgnY, int cnPoints); #endif
} // end of namespace TtfUtil
} // end of namespace graphite2
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.14 Sekunden
(vorverarbeitet am 2026-08-25)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.