Path: blob/master/thirdparty/graphite/src/inc/NameTable.h
9906 views
// SPDX-License-Identifier: MIT OR MPL-2.0 OR LGPL-2.1-or-later OR GPL-2.0-or-later1// Copyright 2010, SIL International, All rights reserved.23#pragma once45#include <graphite2/Segment.h>6#include "inc/TtfTypes.h"7#include "inc/locale2lcid.h"89namespace graphite2 {1011class NameTable12{13NameTable(const NameTable &);14NameTable & operator = (const NameTable &);1516public:17NameTable(const void * data, size_t length, uint16 platfromId=3, uint16 encodingID = 1);18~NameTable() { free(const_cast<TtfUtil::Sfnt::FontNames *>(m_table)); }19enum eNameFallback {20eNoFallback = 0,21eEnUSFallbackOnly = 1,22eEnOrAnyFallback = 223};24uint16 setPlatformEncoding(uint16 platfromId=3, uint16 encodingID = 1);25void * getName(uint16 & languageId, uint16 nameId, gr_encform enc, uint32 & length);26uint16 getLanguageId(const char * bcp47Locale);2728CLASS_NEW_DELETE29private:30uint16 m_platformId;31uint16 m_encodingId;32uint16 m_languageCount;33uint16 m_platformOffset; // offset of first NameRecord with for platform 3, encoding 134uint16 m_platformLastRecord;35uint16 m_nameDataLength;36const TtfUtil::Sfnt::FontNames * m_table;37const uint8 * m_nameData;38Locale2Lang m_locale2Lang;39};4041} // namespace graphite2424344