-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Font rendering depends on DXF viewer/application #733
Comments
All text rendering in In the example script below I have to use the This is the BricsCAD, it does not match: The And the ... and Autodesk DWG TrueView can't render Example script: from pathlib import Path
import ezdxf
from ezdxf.math import Matrix44
from ezdxf import path, fonts, zoom
from ezdxf.addons import text2path
CWD = Path("~/Desktop/Outbox").expanduser()
if not CWD.exists():
CWD = Path(".")
doc = ezdxf.new()
msp = doc.modelspace()
doc.styles.new('SimSun', dxfattribs={'font': 'simsun.ttc'})
height = 2.7
first_path = text2path.make_paths_from_str("厂牌AAA123", fonts.FontFace(family="SimSun"), height)
final_paths = path.transform_paths(first_path, Matrix44.translate(1.810846223812833, 1.482741896976211, 0))
text2 = msp.add_text(
"厂牌AAA123",
dxfattribs={
"style": "SimSun",
"height": height
},
).set_placement((1.810846223812833, 1.482741896976211))
path.render_splines_and_polylines(msp, final_paths, dxfattribs={"color": 1})
zoom.extents(msp)
doc.saveas(CWD / "text2path.dxf") UPDATE: Text is rendered by |
This issue stays open for easy finding. |
after testing:The ratio of hollowed-out fonts to the original text is 1.45.(font: KaiTi.ttf、SimHei.ttf、FangSong.ttf)
|
@shine-flower if you just want to render the CAD file. You can refer this #724 |
Update: Text is rendered by |
code:height is 2.7. How to make the height of hollow characters consistent with the height of ordinary characters?
result:
The text was updated successfully, but these errors were encountered: