Example #1
0
        /// <summary>
        /// Gets TEXTMETRICW structure
        /// </summary>
        /// <returns>Text metric class</returns>
        public WinTextMetric GetTextMetricsApi()
        {
            // allocate buffer to receive outline text metrics information
            AllocateBuffer(57);

            // get outline text metrics information
            if (GetTextMetrics(GDIHandle, Buffer) == 0)
            {
                ThrowSystemErrorException("Calling GetTextMetrics API failed.");
            }

            // create WinOutlineTextMetric class
            WinTextMetric WTM = new WinTextMetric(this);

            // free buffer for outline text metrics
            FreeBuffer();

            // exit
            return(WTM);
        }
Example #2
0
 internal WinOutlineTextMetric
 (
     FontApi DC
 )
 {
     otmSize       = DC.ReadUInt32();
     otmTextMetric = new WinTextMetric(DC);
     DC.Align4();
     otmPanoseNumber = new WinPanose(DC);
     DC.Align4();
     otmfsSelection         = DC.ReadUInt32();
     otmfsType              = DC.ReadUInt32();
     otmsCharSlopeRise      = DC.ReadInt32();
     otmsCharSlopeRun       = DC.ReadInt32();
     otmItalicAngle         = DC.ReadInt32();
     otmEMSquare            = DC.ReadUInt32();
     otmAscent              = DC.ReadInt32();
     otmDescent             = DC.ReadInt32();
     otmLineGap             = DC.ReadUInt32();
     otmsCapEmHeight        = DC.ReadUInt32();
     otmsXHeight            = DC.ReadUInt32();
     otmrcFontBox           = new FontBox(DC);
     otmMacAscent           = DC.ReadInt32();
     otmMacDescent          = DC.ReadInt32();
     otmMacLineGap          = DC.ReadUInt32();
     otmusMinimumPPEM       = DC.ReadUInt32();
     otmptSubscriptSize     = DC.ReadWinPoint();
     otmptSubscriptOffset   = DC.ReadWinPoint();
     otmptSuperscriptSize   = DC.ReadWinPoint();
     otmptSuperscriptOffset = DC.ReadWinPoint();
     otmsStrikeoutSize      = DC.ReadUInt32();
     otmsStrikeoutPosition  = DC.ReadInt32();
     otmsUnderscoreSize     = DC.ReadInt32();
     otmsUnderscorePosition = DC.ReadInt32();
     otmpFamilyName         = DC.ReadString();
     otmpFaceName           = DC.ReadString();
     otmpStyleName          = DC.ReadString();
     otmpFullName           = DC.ReadString();
     return;
 }