applying shx textstyle
applying shx textstyle
hi,
i am using the code of odwriteex to add a textstyle to database. when i use a ttf everything is ok, when i use shx fonts the audit report gives a problem when it is assigned to a text.
code:
// name must be set before a table object is added to a table. the
// isshapefile flag must also be set (if true) before adding the object
// to the database.
pstyle->setname(atextstyle.name);
pstyle->setisshapefile(atextstyle.isshapefile);
// add the object to the table.
pstyles->add(pstyle);
// set the remaining properties.
pstyle->settextsize(atextstyle.height);
pstyle->setpriorsize(atextstyle.priorsize);
pstyle->setxscale(atextstyle.widthfactor);
pstyle->setobliquingangle(atextstyle.obliquingangle);
pstyle->setfilename(atextstyle.fontfile);
if (atextstyle.usebigfontfile)
pstyle->setbigfontfilename(atextstyle.bigfontfile);
odstring odfontface(atextstyle.font.typeface);
if (!odfontface.isempty())
pstyle->setfont(odfontface, atextstyle.font.bold, atextstyle.font.italic, atextstyle.font.charset, atextstyle.font.pitchandfamily);attached files
the problem is that in the file you attached the text style style1 is a shape style.
isshapefile determines not if the style is ttf or shx.
for text styles (both shx and ttf) isshapefile() should be false.
shapefile is true for shape (not text) styles. they are unnamed. they contain definitions not for text characters but for a special symbols used for example in linetypes.
if a style is used for texts it should not be "shapefile"
sergey slezkin
thank you. i didn't understand the shape file parameter.
i apply these effects to the textstyle:
pstyle->setisupsidedown(atextstyle.isupsidedown);
pstyle->setisbackwards(atextstyle.isbackwards);
pstyle->setisvertical(atextstyle.isvertical);
and all work fine except the setisvertical. (i am using 2.7 beta)
could you be more detailed what is wrong?
sergey slezkin
nothing is wrong. i didn't realize that for ttf fonts and some shx fonts it is not possible to set vertical. sorry about that.
although this brings another question, how do i identify which fonts can be set to vertical?
found it in the documentation: odfont::supportsverticalmode()
however it seems to return true for all shx... even when acad says it doesn't support vertical. then when i vectorize, it appears horizontal.
last edited by
billyaraujo@gmail.com; 18th december 2008 at 10:43 amfff">.
quote:
originally posted by
billyaraujo@gmail.com
found it in the documentation: odfont::supportsverticalmode()
however it seems to return true for all shx... even when acad says it doesn't support vertical. then when i vectorize, it appears horizontal.
hello
supportsverticalmode() for shx font returns value of mode flag ( one bit is indicated support vertical mode).
could you give us example font for which dwgdirect returns incorrect this value ?
best regards,
sergey z.
the error occurred because i was defining both setfilename and setfont:
code:
odgitextstyle textstyle;
textstyle.setfilename(odstring((*afont).filename));
textstyle.setfont(odstring((*afont).typeface), (*afont).bold, (*afont).italic, (*afont).charset, (*afont).pitchandfamily);
hello
you needn't use both methods. use setfilename() for shx font and setfont() for ttf.
best regards,
sergey z.