Ejemplo n.º 1
0
            public JstfLangSys_val GetDefJstfLangSysTable_val()
            {
                JstfLangSys_val djls = null;

                if (DefJstfLangSysOffset != 0)
                {
                    uint offset = m_offsetJstfScript + (uint)DefJstfLangSysOffset;
                    djls = new JstfLangSys_val((ushort)offset, m_bufTable);
                }

                return(djls);
            }
Ejemplo n.º 2
0
            public bool Validate(Validator v, string sIdentity, OTTable table)
            {
                bool bRet = true;

                // check for data overlap
                bRet &= ((val_JSTF)table).ValidateNoOverlap(m_offsetJstfScript, CalcLength(), v, sIdentity, table.GetTag());

                // check the ExtenderGlyph offset
                if (ExtenderGlyphOffset != 0)
                {
                    if (m_offsetJstfScript + ExtenderGlyphOffset > m_bufTable.GetLength())
                    {
                        v.Error(T.T_NULL, E.JSTF_E_Offset_PastEOT, table.m_tag, sIdentity + ", ExtenderGlyph");
                        bRet = false;
                    }
                }

                // check the ExtenderGlyph table
                if (ExtenderGlyphOffset != 0)
                {
                    ExtenderGlyph_val eg = GetExtenderGlyphTable_val();
                    bRet &= eg.Validate(v, sIdentity + ", ExtenderGlyph", table);
                }

                // check the DefJstfLangSys offset
                if (DefJstfLangSysOffset != 0)
                {
                    if (m_offsetJstfScript + DefJstfLangSysOffset > m_bufTable.GetLength())
                    {
                        v.Error(T.T_NULL, E.JSTF_E_Offset_PastEOT, table.m_tag, sIdentity + ", DefJstfLangSys");
                        bRet = false;
                    }
                }

                // check the DefJstfLangSys table
                if (DefJstfLangSysOffset != 0)
                {
                    JstfLangSys_val jls = GetDefJstfLangSysTable_val();
                    bRet &= jls.Validate(v, sIdentity + ", DefJstfLangSys", table);
                }

                // check the JstfLangSysRecord array length
                if (m_offsetJstfScript + (uint)FieldOffsets.JstfLangSysRecords + JstfLangSysCount * 6 > m_bufTable.GetLength())
                {
                    v.Error(T.T_NULL, E.JSTF_E_Array_pastEOT, table.m_tag, sIdentity + ", JstfLangSysRecord array");
                    bRet = false;
                }

                // check the JstfLangSysRecord array order
                if (JstfLangSysCount > 1)
                {
                    for (uint i = 0; i < JstfLangSysCount - 1; i++)
                    {
                        JstfLangSysRecord jlsrCurr = GetJstfLangSysRecord(i);
                        JstfLangSysRecord jlsrNext = GetJstfLangSysRecord(i);

                        if (jlsrCurr.JstfLangSysTag >= jlsrNext.JstfLangSysTag)
                        {
                            v.Error(T.T_NULL, E.JSTF_E_Array_order, table.m_tag, sIdentity + ", JstfLangSysRecord[" + i + "]");
                            bRet = false;
                            break;
                        }
                    }
                }

                // check each JstfLangSysRecord
                for (uint i = 0; i < JstfLangSysCount; i++)
                {
                    JstfLangSysRecord jlsr = GetJstfLangSysRecord(i);

                    // check the tag
                    if (!jlsr.JstfLangSysTag.IsValid())
                    {
                        v.Error(T.T_NULL, E.JSTF_E_tag, table.m_tag, sIdentity + ", JstfLangSysRecord[" + i + "]");
                        bRet = false;
                    }

                    // check the JstfLangSys offset
                    if (m_offsetJstfScript + jlsr.JstfLangSysOffset > m_bufTable.GetLength())
                    {
                        v.Error(T.T_NULL, E.JSTF_E_Offset_PastEOT, table.m_tag, sIdentity + ", JstfLangSysRecord[" + i + "]");
                        bRet = false;
                    }

                    // check the JstfLangSys table
                    JstfLangSys_val jls = GetJstfLangSysTable_val(jlsr);
                    bRet &= jls.Validate(v, sIdentity + ", JstfLangSysRecord[" + i + "], JstfLangSys", table);
                }

                return(bRet);
            }
Ejemplo n.º 3
0
            public JstfLangSys_val GetDefJstfLangSysTable_val()
            {
                JstfLangSys_val djls = null;

                if (DefJstfLangSysOffset != 0)
                {
                    uint offset = m_offsetJstfScript + (uint)DefJstfLangSysOffset;
                    djls = new JstfLangSys_val((ushort)offset, m_bufTable);
                }

                return djls;
            }