1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-08 14:17:06 +03:00

0024272: Provide basic text formatting routines for Font_BRepFont

Add new class Font_BRepTextBuilder for generation of formatted BRep text.
Delete method Font_BRepFont::RenderText(), which should be replaced by Font_BRepTextBuilder::Perform().
This commit is contained in:
isk
2015-08-24 14:10:22 +03:00
committed by ski
parent 2eea6525af
commit ac84fcf602
22 changed files with 487 additions and 149 deletions

View File

@@ -96,7 +96,7 @@ thrusections -N thread 1 0 tw1 tw2
puts "Putting together and writing \"Open CASCADE\"..."
# define text
text2brep text2d OpenCASCADE Times-Roman 8 bold composite=0
text2brep text2d OpenCASCADE -font Times-Roman -height 8 -aspect bold -composite off
prism text text2d 0 0 2
trotate text 0 0 0 0 1 0 90
ttranslate text 24.75 -2 65

View File

@@ -77,10 +77,10 @@ set font "Arial Unicode MS"
#text2brep title $text "Arial Unicode MS" 1.7 x=10 y=24 z=4.51
# alternative variant to work-around issue #25852
set text "i\u20dd\u20dd11\nINTEL\u20dd CORE\u2122 i7-4790\nSR1QF 3.60GHZ\nMALAY\nL411B540 \u20dd"
text2brep title0 $text $font 1.7 x=10 y=24 z=4.51
text2brep title1 " M C" $font 0.77 x=10 y=24.2 z=4.51
text2brep title2 "R" $font 0.77 x=15.3 y=21.9 z=4.51
text2brep title3 "e4" $font 0.7 x=18.6 y=15.1 z=4.51
text2brep title0 $text -font $font -height 1.7 -pos 10 24 4.51 -valign topfirstline
text2brep title1 " M C" -font $font -height 0.77 -pos 10 24.2 4.51
text2brep title2 "R" -font $font -height 0.77 -pos 15.3 21.9 4.51
text2brep title3 "e4" -font $font -height 0.7 -pos 18.6 15.1 4.51
compound title0 title1 title2 title3 title
puts "Adding contact pads..."

View File

@@ -27,7 +27,7 @@ bcommon body b e
bcut body body c
bcommon core cx e
text2brep text "CAD Assistant" Times 10
text2brep text "CAD Assistant" -font Times -height 10
ttranslate text 10 -4 10
prism tr text 0 0 -1
bfuse body body tr

View File

@@ -107,13 +107,13 @@ polyline t9 154 -80 0 154 -60 0
compound frame t1 t2 t3 t4 t5 t6 t7 t8 t9 lines
# add text
text2brep sample "SAMPLE" Arial 10 x=90 y=-55 bolditalic
text2brep occ "Open CASCADE" Times 6 x=125 y=-95
text2brep name "Snowflake" Courier 7 x=65 y=-75 italic
text2brep material "Ice" Courier 7 x=75 y=-95 italic
text2brep sheets "Sheets 1" Courier 3.5 x=145 y=-83 italic
text2brep scale "Scale\n\n1:100" Courier 3.5 x=157 y=-63 italic
text2brep mass "Mass\n\n1 mg" Courier 3.5 x=140 y=-63 italic
text2brep sample "SAMPLE" -font Arial -height 10 -pos 90 -55 0 -aspect bolditalic
text2brep occ "Open CASCADE" -font Times -height 6 -pos 125 -95 0
text2brep name "Snowflake" -font Courier -height 7 -pos 65 -75 0 -aspect italic
text2brep material "Ice" -font Courier -height 7 -pos 75 -95 0 -aspect italic
text2brep sheets "Sheets 1" -font Courier -height 3.5 -pos 145 -83 0 -aspect italic
text2brep scale "Scale\n\n1:100" -font Courier -height 3.5 -pos 157 -63 0 -aspect italic -valign topfirstline
text2brep mass "Mass\n\n1 mg" -font Courier -height 3.5 -pos 140 -63 0 -aspect italic -valign topfirstline
eval compound [explode sample w] sample
eval compound [explode occ w] occ
eval compound [explode name w] name