>

FMX Android 文字显示澳门博发娱乐官网「锯齿」效

- 编辑:澳门博发娱乐官网 -

FMX Android 文字显示澳门博发娱乐官网「锯齿」效

说明:调整 Firemonkey Android 显示文字有「锯齿」效果

调整 FMX Android 文字显示「锯齿」效果,android

说明:调整 Firemonkey Android 显示文字有「锯齿」效果

适用:Firemonkey Android 平台

修改方法:

请将源码 FMX.FontGlyphs.Android.pas 复制到自己的工程目录里,再进行修改。

// 找到这行
FPaint.setAntiAlias(True); // 抗锯齿

// 改成如下
FPaint.setAntiAlias(False); // 锯齿

效果:

上(抗锯齿)FPaint.setAntiAlias(True);

下(锯齿)FPaint.setAntiAlias(False);

澳门博发娱乐官网 1

FMX Android 文字显示「锯齿」效果,android 说明:调整 Firemonkey Android 显示文字有「锯齿」效果 适用:Firemonkey Android 平台 修改方法: 请...

[修正] Firemonkey Android 文字斜粗体显示不全的问题,firemonkeyandroid

问题:Firemonkey Android 平台显示斜粗体文字时,文字右方会有显示不全的问题。

 

修正代码:

请将 FMX.FontGlyphs.Android.pas 复制到自己的工程目录下,再修改如下代码:

function TAndroidFontGlyphManager.DoGetGlyph

... 略 ...

      if Bounds.left < 0 then
        Width := Width - Bounds.left;

{+++>}
      // 加入修正代码: 文字斜粗显示 by Aone 2017.05.26
      if FPaint.getTypeface.isItalic then
      begin
           if FPaint.getTypeface.isBold then
                Width := Round(Width * 1.2375)
           else Width := Round(Width * 1.125);
      end;
{<+++}

      Bitmap := TJBitmap.JavaClass.createBitmap(Width, Height, TJBitmap_Config.JavaClass.ARGB_8888);

... 略 ...

end;

 

修正效果:

未修正 修正后

] Firemonkey Android 文字斜粗体显示不全的问题,firemonkeyandroid 问题:Firemonkey Android 平台显示斜粗体文字时,文字右方会有显示不全的问...

[修正] Firemonkey Android 显示 Emoji (颜文字),firemonkeyemoji

问题:在 Android 平台下,显示 Emoji 文字,无法显示彩色(皆为黑色),例如 Edit 控件,即使将 Edit.ControlType = Platform 设为平台原生控件,还是没用(真机测试 Edit.ControlType 设定为 Style 与 Platform 是一样的,而 iOS 平台则不同)。

修正方法:

请将源码 FMX.TextLayout.GPU.pas 复制到自己的工程目录里,再进行修改。

procedure TTextLayoutNG.DoDrawLayout(const ACanvas: TCanvas);
var

...略...

{+++>}Char: UCS4Char; // 加入此行代码 by Aone (2016.11.18)
begin

...略...

      for K := 0 to LRun.Chars.Count - 1 do
      begin
{+++>}  Char := LRun.Chars[K]; // 加入此行代码 by Aone (2016.11.18)
        Rec := AddOrGetChar(ACanvas, LRun.Chars[K], CharDic, LRun.Font);

...略...

{---> ColoredGlyph := TFontGlyphStyle.ColorGlyph in Rec.Glyph.Style; // 删除此代码
{+++>}
    // 加下下列代码 by Aone (2016.11.18),取自: FMX.FontGlyphs.iOS
    ColoredGlyph :=
    (Char = $10086)or
    (Char = $1F004) or
    (Char = $1F0CF) or
    (Char = $1F170) or
    (Char = $1F171) or
    (Char = $1F17E) or
    (Char = $1F17F) or
    (Char = $1F18F) or
    ((Char >= $1F191) and (Char <= $1F19A)) or
    (Char = $1F201) or
    (Char = $1F202) or
    (Char = $1F21A) or
    (Char = $1F22F) or
    ((Char >= $1F232) and (Char <= $1F23A)) or
    (Char = $1F250) or
    (Char = $1F251) or
    ((Char >= $1F300) and (Char <= $1F320)) or
    ((Char >= $1F330) and (Char <= $1F393)) or
    ((Char >= $1F3A0) and (Char <= $1F3F0)) or
    ((Char >= $1F400) and (Char <= $1F43E)) or
    (Char = $1F440) or
    ((Char >= $1F442) and (Char <= $1F49F)) or
    ((Char >= $1F4A0) and (Char <= $1F4FC)) or
    ((Char >= $1F500) and (Char <= $1F53D)) or
    ((Char >= $1F550) and (Char <= $1F567)) or
    ((Char >= $1F5FB) and (Char <= $1F64F)) or
    ((Char >= $1F680) and (Char <= $1F6C5)) or
    (Char = $2139) or
    ((Char >= $2194) and (Char <= $2199)) or
    (Char = $21A9) or
    (Char = $21AA) or
    (Char = $231A) or
    (Char = $231B) or
    ((Char >= $23E9) and (Char <= $23EC)) or
    (Char = $23F0) or
    (Char = $23F3) or
    (Char = $24C2) or
    (Char = $25AA) or
    (Char = $25AB) or
    (Char = $25B6) or
    (Char = $25C0) or
    ((Char >= $25FB) and (Char <= $25FE)) or
    (Char = $2600) or
    (Char = $2601) or
    (Char = $260E) or
    (Char = $2611) or
    (Char = $2614) or
    (Char = $2615) or
    (Char = $261D) or
    (Char = $263A) or
    ((Char >= $2648) and (Char <= $2653)) or
    (Char = $2660) or
    (Char = $2663) or
    (Char = $2665) or
    (Char = $2666) or
    (Char = $2668) or
    (Char = $267B) or
    (Char = $267F) or
    (Char = $2693) or
    (Char = $26A0) or
    (Char = $26A1) or
    (Char = $26AA) or
    (Char = $26AB) or
    (Char = $26BD) or
    (Char = $26BE) or
    (Char = $26C4) or
    (Char = $26C5) or
    (Char = $26CE) or
    (Char = $26D4) or
    (Char = $26EA) or
    (Char = $26F2) or
    (Char = $26F3) or
    (Char = $26F5) or
    (Char = $26FA) or
    (Char = $26FD) or
    (Char = $2702) or
    (Char = $2705) or
    ((Char >= $2708) and (Char <= $270F)) or
    (Char = $2712) or
    (Char = $2714) or
    (Char = $2716) or
    (Char = $2728) or
    (Char = $2733) or
    (Char = $2734) or
    (Char = $2744) or
    (Char = $2747) or
    (Char = $274C) or
    (Char = $274E) or
    ((Char >= $2753) and (Char <= $2755)) or
    (Char = $2757) or
    (Char = $2764) or
    ((Char >= $2795) and (Char = $2797)) or
    (Char = $27B0) or
    (Char = $27BF) or
    (Char = $2934) or
    (Char = $2935) or
    ((Char >= $2B05) and (Char = $2B07)) or
    (Char = $2B1B) or
    (Char = $2B1C) or
    (Char = $2B50) or
    (Char = $2B55) or
    (Char = $3030) or
    (Char = $303D) or
    (Char = $3297) or
    (Char = $3299);
{<+++}

...略...

end;

 

效果:

澳门博发娱乐官网 2

 

官方相关 QC:

] Firemonkey Android 显示 Emoji (颜文字),firemonkeyemoji 问题:在 Android 平台下,显示Emoji 文字,无法显示彩色(皆为黑色),例如 Edit 控件...

适用:Firemonkey Android 平台

修改方法:

本文由胜博发-编程发布,转载请注明来源:FMX Android 文字显示澳门博发娱乐官网「锯齿」效