mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-03 17:56:21 +03:00
35 lines
942 B
Plaintext
35 lines
942 B
Plaintext
puts "============"
|
|
puts "OCC24181 Render text as BRep"
|
|
puts "============"
|
|
puts ""
|
|
pload MODELING
|
|
pload VISUALIZATION
|
|
|
|
vfont add [locate_data_file DejaVuSans.ttf] SansFont
|
|
|
|
set THE_TEXT "The quick brown fox\njumps over the lazy dog!"
|
|
set THE_FONT_NAME SansFont
|
|
set THE_FONT_SIZES {12 18 24}
|
|
|
|
vsetdispmode 1
|
|
vtop
|
|
|
|
set aLine 0
|
|
set aLineId 0
|
|
foreach aSize $THE_FONT_SIZES {
|
|
set aText "\[$aSize\] $THE_TEXT"
|
|
|
|
vpoint aPnt_$aSize 0.0 $aLine 0.0
|
|
vdrawtext "Line_$aLineId" $aText -pos 0.0 $aLine 0.0 -color 0.0 1.0 1.0 -halign left -valign top -angle 000 -zoom 1 -height $aSize -aspect bolditalic -font $THE_FONT_NAME
|
|
|
|
text2brep aBText_$aSize $aText -font $THE_FONT_NAME -height $aSize -aspect bolditalic -composite off -pos 0.0 $aLine 0.0 -valign topfirstline
|
|
vdisplay aBText_$aSize
|
|
set aLine [expr $aLine - 4.0 * $aSize]
|
|
set aLineId [expr $aLineId + 1]
|
|
}
|
|
|
|
vfit
|
|
|
|
vglinfo
|
|
checkview -screenshot -3d -path ${imagedir}/${test_image}.png
|