具有GlobalUseDirect2D的Firemonkey XE4字体= false(Firemonkey XE4 Fonts with GlobalUseDirect2D = false)

编程入门 行业动态 更新时间:2024-10-27 07:29:45
具有GlobalUseDirect2D的Firemonkey XE4字体= false(Firemonkey XE4 Fonts with GlobalUseDirect2D = false)

字体不会随之改变

GlobalUseDirect2D := false;

所有这些都是'Segoe UI'。

我能做什么,字体可以用GDI +定制?

Delphi XE4,Firemonkey HD表格。

Fonts don't changes with

GlobalUseDirect2D := false;

and all of them are 'Segoe UI'.

What I can do, that fonts can be customizable with GDI+?

Delphi XE4, Firemonkey HD forms.

最满意答案

谢谢,我修好了。 还有一次关于这个问题:我关闭了GlobalUseDirect2D并且所有文本都将FontFamily作为'Tahoma',即使它是'Comic Sans MS',例如。

UPD它没有完全修复。 字体随机播放。

UPD2现在它是正确的。

FMX.Canvas.GDIP.pas中的修复代码:

procedure TTextLayoutGDIPlus.DoRenderLayout; var i: Integer; LRegion: TRegion; begin if not Assigned(FStringFormat) or not Assigned(FGraphics) then Exit; FreeAndNil(FGPFont); if Assigned(LayoutCanvas) then begin //FIX BEGIN TCanvasGdiPlus(LayoutCanvas).Font.Assign(Font); //FIX END if not TCanvasGdiPlus(LayoutCanvas).FGPFamily.IsStyleAvailable(vgStyleToGPStyle(Font.Style)) then begin FGPFont := TGPFont.Create(TCanvasGdiPlus(LayoutCanvas).FGPFamily, Font.Size * 0.75 * TCanvasGdiPlus(LayoutCanvas).FFontScale, 0); if not Assigned(FGPFont) then FGPFont := TGPFont.Create(TCanvasGdiPlus(LayoutCanvas).FGPFamily, Font.Size * 0.75 * TCanvasGdiPlus(LayoutCanvas).FFontScale, vgStyleToGPStyle(Font.Style)); end else FGPFont := TGPFont.Create(TCanvasGdiPlus(LayoutCanvas).FGPFamily, Font.Size * 0.75 * TCanvasGdiPlus(LayoutCanvas).FFontScale, vgStyleToGPStyle(Font.Style), UnitPoint); end

Thanks, I fixed it. One more time about the problem: I turn off GlobalUseDirect2D and all text have FontFamily as 'Tahoma', even it is 'Comic Sans MS', for example.

UPD It's not full fix. Fonts shuffle.

UPD2 Now it's right fixed.

Code of fix in FMX.Canvas.GDIP.pas:

procedure TTextLayoutGDIPlus.DoRenderLayout; var i: Integer; LRegion: TRegion; begin if not Assigned(FStringFormat) or not Assigned(FGraphics) then Exit; FreeAndNil(FGPFont); if Assigned(LayoutCanvas) then begin //FIX BEGIN TCanvasGdiPlus(LayoutCanvas).Font.Assign(Font); //FIX END if not TCanvasGdiPlus(LayoutCanvas).FGPFamily.IsStyleAvailable(vgStyleToGPStyle(Font.Style)) then begin FGPFont := TGPFont.Create(TCanvasGdiPlus(LayoutCanvas).FGPFamily, Font.Size * 0.75 * TCanvasGdiPlus(LayoutCanvas).FFontScale, 0); if not Assigned(FGPFont) then FGPFont := TGPFont.Create(TCanvasGdiPlus(LayoutCanvas).FGPFamily, Font.Size * 0.75 * TCanvasGdiPlus(LayoutCanvas).FFontScale, vgStyleToGPStyle(Font.Style)); end else FGPFont := TGPFont.Create(TCanvasGdiPlus(LayoutCanvas).FGPFamily, Font.Size * 0.75 * TCanvasGdiPlus(LayoutCanvas).FFontScale, vgStyleToGPStyle(Font.Style), UnitPoint); end

更多推荐

本文发布于:2023-07-30 12:41:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1337889.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:字体   Firemonkey   GlobalUseDirect2D   Fonts   false

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!