Thanks to visit codestin.com
Credit goes to github.com

Skip to content

TSkTypeface.MakeFromName ignores the AStyle parameter #422

@Lasibian

Description

@Lasibian

TSkTypeface.MakeFromName ignores the AStyle parameter in Skia4d 7.0.1. It works in skia4d 6.0.0. The result is that weight, slant and width of a font are ignored.

VCL test case:

procedure TForm1.Button2Click(Sender: TObject);
var
  LTypeFace: ISkTypeface;
begin
  LTypeface := TSkTypeface.MakeFromName('Arial', TSkFontStyle.Create(400, Ord(TSkFontWidth.Normal), TSkFontSlant.Upright));
  if LTypeface.Weight <> 400 then
    ShowMessage('Weight <> 400');  // ok in Skia4d 6+7

  LTypeface := TSkTypeface.MakeFromName('Arial', TSkFontStyle.Create(700, Ord(TSkFontWidth.Normal), TSkFontSlant.Upright));
  if LTypeface.Weight <> 700 then
    ShowMessage('Weight <> 700');  // ok in Skia4d 6, fails in Skia4d 7

  LTypeface := TSkTypeface.MakeFromName('Arial', TSkFontStyle.Create(400, Ord(TSkFontWidth.Normal), TSkFontSlant.Italic));
  if LTypeface.Slant <> TSkFontSlant.Italic then
    ShowMessage('Font is not italic'); // ok in Skia4d 6, fails in Skia4d 7
end;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions