示例#1
0
        public int[] GetLogicalWidths(Win32DCSafeHandle hdc, FontCache fontCache)
        {
            GlyphData glyphData = this.GetGlyphData(hdc, fontCache);

            int[] array = new int[this.m_text.Length];
            int   num   = Win32.ScriptGetLogicalWidths(ref this.SCRIPT_ANALYSIS, this.m_text.Length, glyphData.GlyphScriptShapeData.GlyphCount, glyphData.ScaledAdvances, glyphData.GlyphScriptShapeData.Clusters, glyphData.GlyphScriptShapeData.VisAttrs, array);

            if (Win32.Failed(num))
            {
                Marshal.ThrowExceptionForHR(num);
            }
            if (glyphData.Scaled)
            {
                for (int i = 0; i < array.Length; i++)
                {
                    array[i] = glyphData.Scale(array[i]);
                }
            }
            return(array);
        }