Exemplo n.º 1
0
        public OTFont(OTFile f, uint fileOffset, uint ttcIndex)
        {
            // Used only for TTCs

            _file         = f;
            _offsetInFile = fileOffset;
            _ttcIndex     = ttcIndex;
            _isInTtc      = true;
            _defaultLabel = f.GetFileInfo().Name + ":" + ttcIndex.ToString();

            if (ttcIndex >= f.NumFonts)
            {
                throw new ArgumentOutOfRangeException("TTCIndex", "TTCIndex is greater than the last font index (number of fonts - 1)");
            }

            MemoryStream ms = f.GetMemoryStream();

            if (fileOffset >= ms.Length)
            {
                _validationStatus |= OTFile.OTFileValidation_StructureOffsetOutOfRange;
                throw new ArgumentOutOfRangeException("fileOffset", "The offset in fileOffset is greater than the length of the file");
            }

            ReadFont_Internal(ms);
        }
Exemplo n.º 2
0
        // following constructor will result in Offset table for font being read
        // and certain simple tables but not other tables

        public OTFont(OTFile f)
        {
            // used only for single-font file; start of font assumed to be @ 0

            _file         = f;
            _offsetInFile = 0;
            _defaultLabel = f.GetFileInfo().Name;

            MemoryStream ms = f.GetMemoryStream();

            ReadFont_Internal(ms);
        }