public JstfPriority GetJstfPriorityTable(uint i) { JstfPriority jp = null; if (i < JstfPriorityCount) { uint offset = m_offsetJstfLangSys + (uint)GetJstfPriorityOffset(i); jp = new JstfPriority((ushort)offset, m_bufTable); } return(jp); }
static JstfLangSysRecord ReadJstfLangSysRecord(BinaryReader reader) { //Justification Language System Table //The Justification Language System(JstfLangSys) table contains an array of justification suggestions, //ordered by priority. //A text-processing client doing justification should begin with the suggestion that has a zero(0) priority, //and then-as necessary - apply suggestions of increasing priority until the text is justified. //The font developer defines the number and the meaning of the priority levels. //Each priority level stands alone; its suggestions are not added to the previous levels. //The JstfLangSys table consists of a count of the number of priority levels(jstfPriorityCount) and //an array of offsets to Justification Priority tables(jstfPriorityOffsets), //stored in priority order. //JstfLangSys table //stfLangSys table //Type Name Description //uint16 jstfPriorityCount Number of JstfPriority tables //Offset16 jstfPriorityOffsets[jstfPriorityCount] Array of offsets to JstfPriority tables, from beginning of JstfLangSys table, in priority order long tableStartAt = reader.BaseStream.Position; ushort jstfPriorityCount = reader.ReadUInt16(); ushort[] jstfPriorityOffsets = Utils.ReadUInt16Array(reader, jstfPriorityCount); JstfPriority[] jstPriorities = new JstfPriority[jstfPriorityCount]; for (int i = 0; i < jstfPriorityOffsets.Length; ++i) { reader.BaseStream.Position = tableStartAt + jstfPriorityOffsets[i]; jstPriorities[i] = ReadJstfPriority(reader); } return(new JstfLangSysRecord() { jstfPriority = jstPriorities }); }
public JstfPriority GetJstfPriorityTable(uint i) { JstfPriority jp = null; if (i < JstfPriorityCount) { uint offset = m_offsetJstfLangSys + (uint)GetJstfPriorityOffset(i); jp = new JstfPriority((ushort)offset, m_bufTable); } return jp; }