예제 #1
0
 public static VariationSelector[] ReadArray(BinaryReaderFont reader, uint count, long start)
 {
     VariationSelector[] array = new VariationSelector[count];
     for (int i = 0; i < count; i++)
     {
         array[i] = Read(reader, start);
     }
     return(array);
 }
예제 #2
0
        public uint FindGlyphId(int codePoint, int varSelector)
        {
            VariationSelector selector = FindVarSelector(varSelector);

            if (selector == null)
            {
                return(0);
            }
            NonDefaultUVS uvs = selector.nonDefaultUVS;

            return(uvs.FindGlyphId(codePoint));
        }
예제 #3
0
        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);
        }