public uint FindGlyphId(int codePoint, int varSelector) { VariationSelector selector = FindVarSelector(varSelector); if (selector == null) { return(0); } NonDefaultUVS uvs = selector.nonDefaultUVS; return(uvs.FindGlyphId(codePoint)); }
public static NonDefaultUVS Read(BinaryReaderFont reader) { NonDefaultUVS value = new NonDefaultUVS { numUVSMappings = reader.ReadUInt32() }; value.uvsMappings = UVSMapping.ReadArray(reader, value.numUVSMappings); value.uvsMappingsTable = new Dictionary <int, uint>(); for (int i = 0; i < value.uvsMappings.Length; i++) { UVSMapping mapping = value.uvsMappings[i]; value.uvsMappingsTable.Add( mapping.unicodeValue, mapping.glyphID ); } return(value); }
public static VariationSelector Read(BinaryReaderFont reader, long start) { VariationSelector value = new VariationSelector { varSelector = reader.ReadUInt24(), defaultUVSOffset = reader.ReadUInt32(), nonDefaultUVSOffset = reader.ReadUInt32() }; long position = reader.Position; if (value.defaultUVSOffset != 0) { reader.Position = start + value.defaultUVSOffset; value.defaultUVS = DefaultUVS.Read(reader); } if (value.nonDefaultUVSOffset != 0) { reader.Position = start + value.nonDefaultUVSOffset; value.nonDefaultUVS = NonDefaultUVS.Read(reader); } reader.Position = position; return(value); }