zoukankan      html  css  js  c++  java
  • GDI+ 学习记录(24): 输出文本<3>

    //获取字体信息
    var
      fontFamily: TGPFontFamily;
      font: TGPFont;
    begin
      fontFamily := TGPFontFamily.Create('宋体');
      font := TGPFont.Create(fontFamily, 9, FontStyleRegular, UnitPixel);
    
      ShowMessage(FloatToStr(font.GetSize));                             {字号大小}
      ShowMessage(IntToStr(fontFamily.GetEmHeight(FontStyleRegular)));   {字体高度, 采用设计时单位}
      ShowMessage(IntToStr(fontFamily.GetLineSpacing(FontStyleRegular)));{行间距, 采用设计时单位}
      ShowMessage(IntToStr(fontFamily.GetCellAscent(FontStyleRegular))); {上升距, 采用设计时单位}
      ShowMessage(IntToStr(fontFamily.GetCellDescent(FontStyleRegular)));{下降距, 采用设计时单位}
    
      font.Free;
      fontFamily.Free;
    end;
    
    //获取已安装字体的列表 var fonts: TGPFontCollection; fArr: array of TGPFontFamily; count,ti: Integer; s: string; i: Integer; begin fonts := TGPInstalledFontCollection.Create; count := fonts.GetFamilyCount; SetLength(fArr, count); for i := 0 to count - 1 do begin fArr[i] := TGPFontFamily.Create; end; fonts.GetFamilies(count, fArr, ti); Memo1.Clear; for i := 0 to count - 1 do begin fArr[i].GetFamilyName(s); Memo1.Lines.Add(s); fArr[i].Free; end; fonts.Free; end;
  • 相关阅读:
    day63_django_html
    day62_django
    day20
    diango_自定义标签问题
    day64_django_orm
    day16_函数嵌套及对象
    day60_django
    pip 安装问题
    day13_文件操作
    文本溢出显示省略号(…) 小坦克
  • 原文地址:https://www.cnblogs.com/del/p/1017568.html
Copyright © 2011-2022 走看看