Web lists-archives.com

Re: Cygwin fails to utilize Unicode replacement character




Greetings, Steven Penny!

> a character that DejaVu Sans Mono actually doesnt have is:

>     U+01C4 LATIN CAPITAL LETTER DZ WITH CARON

> Using this file:

How to compile it?
Simple "gcc glyph.c" fails with

/tmp/ccSCYXAP.o:glyph.c:(.text+0xbd): undefined reference to `__imp_CreateFontW'
/tmp/ccSCYXAP.o:glyph.c:(.text+0xbd): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__imp_CreateFontW'
/tmp/ccSCYXAP.o:glyph.c:(.text+0xd0): undefined reference to `__imp_SelectObject'
/tmp/ccSCYXAP.o:glyph.c:(.text+0xd0): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__imp_SelectObject'
/tmp/ccSCYXAP.o:glyph.c:(.text+0x111): undefined reference to `__imp_GetGlyphIndicesW'
/tmp/ccSCYXAP.o:glyph.c:(.text+0x111): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__imp_GetGlyphIndicesW'
collect2: error: ld returned 1 exit status

Though I see the header files present at their appropriate places.

>     $ cat glyph.c
>     #include <stdio.h>
>     #include <windows.h>
>     int main()
>     {
>       CONSOLE_FONT_INFOEX ta;
>       ta.cbSize = sizeof ta;
>       GetCurrentConsoleFontEx(GetStdHandle(STD_OUTPUT_HANDLE), 0, &ta);
>       HDC wh = GetDC(0);
>       SelectObject(wh,
>         CreateFontW(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ta.FaceName));
>       WCHAR xr[4] = {0xFFFD, 0x2592, 0x25A1, 0x01C4};
>       WORD zu[4];
>       GetGlyphIndicesW(wh, xr, 4, zu, 1);
>       printf("%ls:\n", ta.FaceName);
>       for (int q = 0; q < 4; q++) {
>         printf("  U+%04X: %s\n",
>         xr[q], zu[q] == 0xffff ? "failure" : "success");
>       }
>     }

> I get this result:

>     DejaVu Sans Mono:
>       U+FFFD: success
>       U+2592: success
>       U+25A1: success
>       U+01C4: failure


-- 
With best regards,
Andrey Repin
Wednesday, September 5, 2018 16:30:20

Sorry for my terrible english...


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple