AndrejMitrovic / DWinProgramming

A collection of D Win32 programming examples

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not an issue, I just want to say thank you !!

kcvinker opened this issue · comments

Hi,
The code in line 83 on "Samples/Chap17/FontRot/EZFont.d" saved me. I was struck when I tried to write the CreateFontIndirectW function. lfFaceName was the problem.

commented

Hi,

Nice to see this is still useful to people.

But there's something I've noticed:

lf.lfFaceName[] = ' ';
// unsure about this, investigate.
lf.lfFaceName[0..szFaceName.length] = szFaceName.toUTF16;

I think the lf.lfFaceName[] = ' '; can probably be removed, it's probably a mistake here. Maybe I didn't understand it was a null-terminated string at the time.

This static char array is now null-terminated by default in https://github.com/dlang/dmd/blob/35abfc4a9fdb74c3d2a6b2698728e827ae981293/druntime/src/core/sys/windows/wingdi.d#L2347

Hi,
Yup, I see that in declaration. But your code worked like a charm. It compiled successfully.