Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2017-06

IsFontNameDefault talk

2 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Alexey

Juha,

you tell that "if LowerCase(s)='default'"

works faster than "if CompareText(s,'default')", but most of the fonts, dont start with letter "d" or "de"=> so CompareText takes one char only, LowerCase takes n chars=> LowerCase slower.

Regards, Alexey

Reply by email

Juha Manninen
to Alexey
Alexey wrote
you tell that "if LowerCase(s)='default'" works faster than "if CompareText(s,'default')", but most of the fonts, dont start with letter "d" or "de"=> so CompareText takes one char only, LowerCase takes n chars=> LowerCase slower.

Yes, actually I realized the same thing.
What more, CompareText() is well optimized and converts ASCII chars quickly one by one.
I can change the code later to use CompareText().

Another thing is that GUI + font handling itself is slow compared to a string comparison which makes this issue rather philosophical...

Juha

Reply by email