Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » Strange issue with text in Painter
Re: Strange issue with text in Painter [message #51056 is a reply to message #51055] |
Thu, 17 January 2019 13:58   |
 |
mirek
Messages: 13930 Registered: November 2005
|
Ultimate Member |
|
|
Tom1 wrote on Thu, 17 January 2019 13:40mirek wrote on Thu, 17 January 2019 14:34What about
void RenderCharacterSys(FontGlyphConsumer& sw, double x, double y, int ch, Font fnt)
{
RLOG(CoWork::GetWorkerIndex() << " RenderCharSys " << fnt << " " << ch << " " << (char)ch);
static Atomic h;
h++;
HFONT hfont = GetWin32Font(fnt, 0);
VERIFY(hfont);
if(hfont) {
HDC hdc = Win32_IC();
HFONT ohfont = (HFONT) ::SelectObject(hdc, hfont);
GLYPHMETRICS gm;
MAT2 m_matrix;
memset(&m_matrix, 0, sizeof(m_matrix));
m_matrix.eM11.value = 1;
m_matrix.eM22.value = 1;
int gsz = GetGlyphOutlineW(hdc, ch, GGO_NATIVE|GGO_UNHINTED, &gm, 0, NULL, &m_matrix);
if(gsz < 0) {
LOGFONT lf;
int ret = GetObject(hfont, sizeof(lf), &lf);
RLOG("Failed " << CoWork::GetWorkerIndex() << " RenderCharSys " << fnt << " " << ch << " " << (char)ch
<< ", real: " << " " << lf.lfFaceName << " " << lf.lfHeight);
RDUMP((void *)hdc);
RDUMP((void *)hfont);
RDUMP(GetLastErrorMessage());
}
VERIFY(gsz >= 0);
if(gsz < 0)
return;
StringBuffer gb(gsz);
gsz = GetGlyphOutlineW(hdc, ch, GGO_NATIVE|GGO_UNHINTED, &gm, gsz, ~gb, &m_matrix);
if(gsz < 0) {
LOGFONT lf;
int ret = GetObject(hfont, sizeof(lf), &lf);
RLOG("Failed2 " << CoWork::GetWorkerIndex() << " RenderCharSys " << fnt << " " << ch << " " << (char)ch
<< ", real: " << " " << lf.lfFaceName << " " << lf.lfHeight);
RDUMP((void *)hdc);
RDUMP((void *)hfont);
RDUMP(GetLastErrorMessage());
}
VERIFY(gsz >= 0);
if(gsz < 0)
return;
RenderCharPath(~gb, gsz, sw, x, y + fnt.GetAscent());
::SelectObject(hdc, ohfont);
}
h--;
VERIFY(h == 0);
}
Again the first VERIFY(gsz >= 0); ASSERTED on line 424. LOG attached...
BR, Tom
It starts to look like Win32 does not like the sharing of HDC... (despite of what the documentation says).
What about this:
void RenderCharacterSys(FontGlyphConsumer& sw, double x, double y, int ch, Font fnt)
{
RLOG(CoWork::GetWorkerIndex() << " RenderCharSys " << fnt << " " << ch << " " << (char)ch);
static Atomic h;
h++;
HFONT hfont = GetWin32Font(fnt, 0);
VERIFY(hfont);
if(hfont) {
HDC hdc = CreateIC("DISPLAY", NULL, NULL, NULL);
HFONT ohfont = (HFONT) ::SelectObject(hdc, hfont);
GLYPHMETRICS gm;
MAT2 m_matrix;
memset(&m_matrix, 0, sizeof(m_matrix));
m_matrix.eM11.value = 1;
m_matrix.eM22.value = 1;
int gsz = GetGlyphOutlineW(hdc, ch, GGO_NATIVE|GGO_UNHINTED, &gm, 0, NULL, &m_matrix);
if(gsz < 0) {
LOGFONT lf;
int ret = GetObject(hfont, sizeof(lf), &lf);
RLOG("Failed " << CoWork::GetWorkerIndex() << " RenderCharSys " << fnt << " " << ch << " " << (char)ch
<< ", real: " << " " << lf.lfFaceName << " " << lf.lfHeight);
RDUMP((void *)hdc);
RDUMP((void *)hfont);
RDUMP(GetLastErrorMessage());
}
VERIFY(gsz >= 0);
if(gsz < 0)
return;
StringBuffer gb(gsz);
gsz = GetGlyphOutlineW(hdc, ch, GGO_NATIVE|GGO_UNHINTED, &gm, gsz, ~gb, &m_matrix);
if(gsz < 0) {
LOGFONT lf;
int ret = GetObject(hfont, sizeof(lf), &lf);
RLOG("Failed2 " << CoWork::GetWorkerIndex() << " RenderCharSys " << fnt << " " << ch << " " << (char)ch
<< ", real: " << " " << lf.lfFaceName << " " << lf.lfHeight);
RDUMP((void *)hdc);
RDUMP((void *)hfont);
RDUMP(GetLastErrorMessage());
}
VERIFY(gsz >= 0);
if(gsz < 0)
return;
RenderCharPath(~gb, gsz, sw, x, y + fnt.GetAscent());
::SelectObject(hdc, ohfont);
::DeleteDC(hdc);
}
h--;
VERIFY(h == 0);
}
|
|
|
 |
|
Strange issue with text in Painter
By: Tom1 on Wed, 09 January 2019 11:23
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Wed, 09 January 2019 13:38
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Thu, 10 January 2019 17:09
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Thu, 10 January 2019 17:26
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Thu, 10 January 2019 17:46
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Fri, 11 January 2019 09:40
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Fri, 11 January 2019 10:07
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Fri, 11 January 2019 10:10
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Fri, 11 January 2019 10:17
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Fri, 11 January 2019 11:05
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Fri, 11 January 2019 11:46
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Fri, 11 January 2019 12:10
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Fri, 11 January 2019 12:12
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Fri, 11 January 2019 12:33
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Fri, 11 January 2019 12:53
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Fri, 11 January 2019 14:33
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Fri, 11 January 2019 15:29
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Fri, 11 January 2019 15:33
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Fri, 11 January 2019 15:43
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Fri, 11 January 2019 18:50
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Sat, 12 January 2019 13:14
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Sat, 12 January 2019 14:57
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Mon, 14 January 2019 09:58
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Mon, 14 January 2019 10:13
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Mon, 14 January 2019 10:18
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Mon, 14 January 2019 10:26
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Mon, 14 January 2019 10:28
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Mon, 14 January 2019 10:42
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Mon, 14 January 2019 10:47
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Mon, 14 January 2019 11:01
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Mon, 14 January 2019 11:07
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Mon, 14 January 2019 11:11
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Mon, 14 January 2019 11:30
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Mon, 14 January 2019 11:32
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Mon, 14 January 2019 11:41
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Mon, 14 January 2019 11:57
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Mon, 14 January 2019 12:03
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Mon, 14 January 2019 12:14
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Mon, 14 January 2019 12:16
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Mon, 14 January 2019 12:22
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Mon, 14 January 2019 13:26
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Mon, 14 January 2019 12:21
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Mon, 14 January 2019 12:30
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Mon, 14 January 2019 12:41
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Mon, 14 January 2019 13:23
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Mon, 14 January 2019 13:53
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Mon, 14 January 2019 14:11
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Mon, 14 January 2019 15:03
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Mon, 14 January 2019 15:18
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Mon, 14 January 2019 15:34
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Mon, 14 January 2019 15:38
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Mon, 14 January 2019 16:08
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Mon, 14 January 2019 17:21
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Mon, 14 January 2019 17:45
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Mon, 14 January 2019 18:31
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Mon, 14 January 2019 18:39
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Mon, 14 January 2019 19:53
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Mon, 14 January 2019 20:51
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Mon, 14 January 2019 20:56
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Tue, 15 January 2019 08:42
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Tue, 15 January 2019 09:11
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Tue, 15 January 2019 09:17
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Tue, 15 January 2019 08:53
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Tue, 15 January 2019 09:15
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Tue, 15 January 2019 09:30
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Mon, 14 January 2019 11:49
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Mon, 14 January 2019 11:52
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Mon, 14 January 2019 11:56
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Mon, 14 January 2019 10:39
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Fri, 11 January 2019 15:47
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Fri, 11 January 2019 19:26
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Tue, 15 January 2019 09:21
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Tue, 15 January 2019 09:23
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Tue, 15 January 2019 09:34
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Tue, 15 January 2019 09:38
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Tue, 15 January 2019 09:51
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Tue, 15 January 2019 09:53
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Tue, 15 January 2019 09:53
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Tue, 15 January 2019 10:06
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Tue, 15 January 2019 09:42
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Tue, 15 January 2019 10:07
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Tue, 15 January 2019 10:19
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Tue, 15 January 2019 13:28
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Tue, 15 January 2019 14:56
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Tue, 15 January 2019 16:20
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Tue, 15 January 2019 16:37
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Wed, 16 January 2019 08:54
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Wed, 16 January 2019 09:18
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Wed, 16 January 2019 09:37
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Wed, 16 January 2019 09:39
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Wed, 16 January 2019 10:45
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Wed, 16 January 2019 10:52
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Wed, 16 January 2019 11:11
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Wed, 16 January 2019 11:35
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Wed, 16 January 2019 11:39
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Wed, 16 January 2019 11:46
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Wed, 16 January 2019 12:00
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Wed, 16 January 2019 12:07
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Wed, 16 January 2019 12:16
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Wed, 16 January 2019 12:47
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Wed, 16 January 2019 13:09
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Wed, 16 January 2019 13:20
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Wed, 16 January 2019 13:26
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Wed, 16 January 2019 14:27
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Wed, 16 January 2019 14:47
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Wed, 16 January 2019 15:14
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Wed, 16 January 2019 15:16
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Wed, 16 January 2019 15:22
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Wed, 16 January 2019 15:40
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Wed, 16 January 2019 16:26
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Wed, 16 January 2019 17:18
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Wed, 16 January 2019 17:18
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Thu, 17 January 2019 08:44
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Thu, 17 January 2019 09:10
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Thu, 17 January 2019 09:15
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Thu, 17 January 2019 09:42
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Thu, 17 January 2019 10:04
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Thu, 17 January 2019 10:07
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Thu, 17 January 2019 10:14
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Thu, 17 January 2019 10:16
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Thu, 17 January 2019 10:19
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Thu, 17 January 2019 10:42
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Thu, 17 January 2019 10:51
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Thu, 17 January 2019 10:54
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Thu, 17 January 2019 11:10
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Thu, 17 January 2019 11:07
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Thu, 17 January 2019 11:28
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Thu, 17 January 2019 11:32
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Thu, 17 January 2019 11:36
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Thu, 17 January 2019 11:43
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Thu, 17 January 2019 11:46
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Thu, 17 January 2019 12:09
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Thu, 17 January 2019 12:28
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Thu, 17 January 2019 12:34
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Thu, 17 January 2019 12:44
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Thu, 17 January 2019 12:47
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Thu, 17 January 2019 12:52
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Thu, 17 January 2019 12:56
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Thu, 17 January 2019 12:59
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Thu, 17 January 2019 13:01
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Thu, 17 January 2019 13:04
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Thu, 17 January 2019 13:12
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Thu, 17 January 2019 13:34
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Thu, 17 January 2019 13:40
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Thu, 17 January 2019 13:58
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Thu, 17 January 2019 14:12
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Thu, 17 January 2019 14:16
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Thu, 17 January 2019 14:24
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Thu, 17 January 2019 14:47
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Thu, 17 January 2019 14:51
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Thu, 17 January 2019 14:52
|
 |
|
Re: Strange issue with text in Painter
By: koldo on Sat, 19 January 2019 17:46
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Thu, 17 January 2019 14:30
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Thu, 17 January 2019 14:33
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Thu, 17 January 2019 14:51
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Thu, 17 January 2019 11:54
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Thu, 17 January 2019 12:17
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Thu, 17 January 2019 12:21
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Thu, 17 January 2019 10:21
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Thu, 17 January 2019 10:19
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Thu, 17 January 2019 09:51
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Wed, 16 January 2019 10:53
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Wed, 16 January 2019 11:31
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Wed, 16 January 2019 09:21
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Wed, 16 January 2019 09:40
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Tue, 15 January 2019 10:21
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Tue, 15 January 2019 11:13
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Tue, 15 January 2019 11:20
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Tue, 15 January 2019 11:23
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Tue, 15 January 2019 11:27
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Tue, 15 January 2019 11:45
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Tue, 15 January 2019 11:45
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Tue, 15 January 2019 11:51
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Tue, 15 January 2019 11:54
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Tue, 15 January 2019 12:27
|
 |
|
Re: Strange issue with text in Painter
By: mirek on Tue, 15 January 2019 14:55
|
 |
|
Re: Strange issue with text in Painter
By: Tom1 on Tue, 15 January 2019 11:43
|
Goto Forum:
Current Time: Tue Sep 26 22:19:35 CEST 2023
Total time taken to generate the page: 0.02342 seconds
|