4 * (C) Copyright IBM Corp. 1998-2003 - All Rights Reserved
9 #include "OpenTypeTables.h"
10 #include "OpenTypeUtilities.h"
11 #include "ScriptAndLanguage.h"
16 const LangSysTable
*ScriptTable::findLanguage(LETag languageTag
, le_bool exactMatch
) const
18 le_uint16 count
= SWAPW(langSysCount
);
19 Offset langSysTableOffset
= exactMatch
? 0 : SWAPW(defaultLangSysTableOffset
);
23 OpenTypeUtilities::getTagOffset(languageTag
, langSysRecordArray
, count
);
25 if (foundOffset
!= 0) {
26 langSysTableOffset
= foundOffset
;
30 if (langSysTableOffset
!= 0) {
31 return (const LangSysTable
*) ((char *)this + langSysTableOffset
);
37 const ScriptTable
*ScriptListTable::findScript(LETag scriptTag
) const
39 le_uint16 count
= SWAPW(scriptCount
);
40 Offset scriptTableOffset
=
41 OpenTypeUtilities::getTagOffset(scriptTag
, scriptRecordArray
, count
);
43 if (scriptTableOffset
!= 0) {
44 return (const ScriptTable
*) ((char *)this + scriptTableOffset
);
50 const LangSysTable
*ScriptListTable::findLanguage(LETag scriptTag
, LETag languageTag
, le_bool exactMatch
) const
52 const ScriptTable
*scriptTable
= findScript(scriptTag
);
54 if (scriptTable
== 0) {
58 return scriptTable
->findLanguage(languageTag
, exactMatch
);