Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes bug in TFPDF.GetStringWidth when char is unicode. #15

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

arimateia
Copy link
Contributor

Code to reproduce error:

var
  pdf: TFPDF;
  text: string;
  w: Double;
begin
  pdf := TFPDF.Create();
  try
    pdf.SetCompression(False);
    pdf.AddPage();
    pdf.SetFont('Arial','B',16);

    text := 'ˆŠO';
    w := pdf.GetStringWidth(text) + 1;

    pdf.Cell(w,10,text);
    pdf.SaveToFile(ExtractFilePath(ParamStr(0))+PathDelim+'test.pdf');
  finally
    pdf.Free;
  end;
end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant