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

gitextstyle
gitextstyle
hi,
i need to retrieve underline,strikeout etc for mtext and text entity.in version 1.11 gitextstyle was member of oddbtextstyletablerecord but in 1.12 it is not a member of oddbtextstyletablerecord.how can i retrieve this data underline,strikeout etc for mtext using 1.12 libraries?how can i get gitextstyle in attached code?is strikeout same as overlined?
class oddbmtext_dumper : public oddbentity_dumper
{
public:
oddbmtext_dumper() {}
void dump(oddbentity* pent) const
{
oddbmtextptr pmtext = pent;
logfont lf;
oddbtextstyletablerecordptr ptextstyle = pmtext->textstyle().safeopenobject();
odgitextstyle gistyle;
bool bold,italic;
int charset, pitchandfamily;
odstring typeface;
ptextstyle->font(typeface,bold,italic,charset, pitchandfamily);
ptextstyle->gitextstyle(gistyle); // getting error
lf.lfitalic = (byte)( gistyle.ttfdecriptor().isitalic());
lf.lfunderline = (byte)(gistyle.isunderlined());
lf.lfstrikeout = (byte)(gistyle.isoverlined());///lfstrikeout = 0;
lf.lfweight = gistyle.ttfdecriptor().isbold() ? fw_bold : fw_dontcare;
lf.lfwidth=0;
lf.lfpitchandfamily=gistyle.ttfdecriptor().pitchan dfamily();
lf.lfcharset=(unsigned char)gistyle.ttfdecriptor().charset();
...........
................
}
thanks
1. dbtextstyletablerecord does not store underline/overline flags.
ttf properties can be get using font() method.
2. underlining/overlining, font etc. can be switched inside mtext by special formatting characters.
you can use oddbmtext::explodefragments() to get separate fragments each having the same properties.
sergey slezkin
yang686526离线中   回复时引用此帖
GDT自动化论坛(仅游客可见)