查看单个帖子
旧 2009-05-06, 11:37 PM   #1
yang686526
高级会员
 
注册日期: 06-11
帖子: 14579
精华: 1
现金: 224494 标准币
资产: 234494 标准币
yang686526 向着好的方向发展
默认 【转帖】problem with ttf

problem with ttf
problem with ttf
i m using ver 1.14 is having problem with ttf fill,
if i straight away draw a text or mtext entity with ttf font,,,,it draws fine
as i draw any entity e.g. line, then draw another text entity it start drawing
as hollow text font instead of filled ttf font..........i had also tried
settextfill function but nothing works.......
plz hav a look on attached file...
plz help..............waiting eagerly for response
attached files
i succeeded in reproducing the problem in odamfcapp (wingdi, gs model turned off)
we'll try to fix it for next release.
sergey slezkin
last edited by mmuratov; 15th february 2006 at 08:13 amfff">.

the immediate workaround for this issue is:
code:
void exgigdigeometry::draw_fillstyle(exgigdigeometry::fillstyle fillstyle)
{
// ttf text can have fillstyles "for selection", "hollow"(?), or "solid"
// all other fillstyles are concidered "solid"
if(m_bprocessingttf && (fillstyle != kfsforselection) && (fillstyle != kfshollow))
fillstyle = kfssolid;
if(m_oldfillstyle != fillstyle)
{
m_oldfillstyle = fillstyle(fillstyle);
m_bbrushvalid = false;
if(m_logbrush.lbstyle == bs_pattern)
::deleteobject((hbitmap)m_logbrush.lbhatch); // delete old bitmap

hbitmap hpatbmp(null);
switch(fillstyle)
{
// these two styles (kcheckerboardfs and ksquaredotsfs)
// requires bitmap to be created
case kfscheckerboard:
{
oduint16 sclns[8];
sclns[0] = 0xff;
sclns[1] = 0xff;
sclns[2] = 0xff - 0x3c;
sclns[3] = 0xff - 0x24;
sclns[4] = 0xff - 0x24;
sclns[5] = 0xff - 0x3c;
sclns[6] = 0xff;
sclns[7] = 0xff;
hpatbmp = ::createbitmap(8, 8, 1, 1, sclns);
m_logbrush.lbhatch = (long)hpatbmp;
m_logbrush.lbstyle = bs_pattern;
break;
}
case kfssquaredots:
{
oduint16 sclns[8];
sclns[0] = 0xff - 0xc0;
sclns[1] = 0xff - 0xc0;
sclns[2] = 0xff;
sclns[3] = 0xff;
sclns[4] = 0xff;
sclns[5] = 0xff;
sclns[6] = 0xff;
sclns[7] = 0xff;
hpatbmp = ::createbitmap(8, 8, 1, 1, sclns);
m_logbrush.lbhatch = (long)hpatbmp;
m_logbrush.lbstyle = bs_pattern;
break;
}

// other fill styles can be found in windows - needn't creating
// bitmap
#ifndef _win32_wce
case kfscrosshatch:
{
m_logbrush.lbhatch = hs_cross;
m_logbrush.lbstyle = bs_hatched;
break;
}
case kfsdiamonds:
{
m_logbrush.lbhatch = hs_diagcross;
m_logbrush.lbstyle = bs_hatched;
break;
}
case kfshorizontalbars:
{
m_logbrush.lbhatch = hs_horizontal;
m_logbrush.lbstyle = bs_hatched;
break;
}
case kfsverticalbars:
{
m_logbrush.lbhatch = hs_vertical;
m_logbrush.lbstyle = bs_hatched;
break;
}
case kfsslantleft:
{
m_logbrush.lbhatch = hs_bdiagonal;
m_logbrush.lbstyle = bs_hatched;
break;
}
case kfsslantright:
{
m_logbrush.lbhatch = hs_fdiagonal;
m_logbrush.lbstyle = bs_hatched;
break;
}
#endif
case kfshollow:
{
m_logbrush.lbstyle = bs_hollow;
break;
}
case kfssolid:
{
m_logbrush.lbstyle = bs_solid;
break;
}
case kfsforselection:
{
hbitmap hpatbmp(null);
oduint16 sclns[8];
sclns[4] = sclns[0] = 0x22;
sclns[5] = sclns[1] = 0x55;
sclns[6] = sclns[2] = 0x88;
sclns[7] = sclns[3] = 0x55;
hpatbmp = ::createbitmap(8, 8, 1, 1, sclns);
m_logbrush.lbhatch = (long)hpatbmp;
m_logbrush.lbstyle = bs_pattern;
break;
}
default:
oda_fail();
break;
}
}
}
fix also will be available in 1.14.02.
sincerely yours,
george udov
last edited by george udov; 15th february 2006 at 08:34 amfff">.
we're using odgigeometrysimplifier::textproc( ... ) with the odgitextstyle parameter using a truetype fonts and we're getting the result seen from the attached bitmap.
the posted workaround will not apply to us right? just wanted to confirm. if so, can you also fix the code in odgigeometrysimplifier? or suggest how we can fix it ourselves.
thanks,
codey
attached images (2.4 kb, 11 views)


dear codey,
i think it is another issue (not related to described by mr cad-mind).
is it reproduce'able in odamfcapp sample?
if no, then you probably handle shellproc primitive incorrectly.
sincerely yours,
george udov
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)