CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

AutoCAD 2019 开发者帮助

关于设置文本高度 (VBA/ActiveX)

2024-5-18 17:50| 发布者: admin| 查看: 12| 评论: 0|原作者: admin|来自: AutoCAD

关于设置文本高度 (VBA/ActiveX)

文本高度决定了您正在使用的字体中字母的大小(以绘图单位为单位)。

该值通常表示大写字母的大小,但 TrueType 字体除外。

对于 TrueType 字体,为文本高度指定的值可能不表示大写字母的高度。指定的高度表示大写字母的高度加上为非英语语言中使用的重音符号和其他标记保留的重音符区。分配给大写字母和重音符号的区域的相对部分由字体设计者在设计字体时确定,因此会因字体而异。

除了大写字母的高度和构成用户指定的高度的上升区域外,TrueType 字体还具有延伸到文本插入行下方的字符部分的下降区域。此类字符的示例包括 y、j、p、g 和 q。

使用属性指定文本高度。此属性仅接受正数。Height

更改 Text 对象的高度

本示例创建一行文本,然后更改文本的高度。

Sub Ch4_ChangeTextHeight()
  Dim textObj As AcadText
  Dim textString As String
  Dim insertionPoint(0 To 2) As Double
  Dim height As Double

  ' Define the text object
  textString = "Hello, World."
  insertionPoint(0) = 3
  insertionPoint(1) = 3
  insertionPoint(2) = 0
  height = 0.5

  ' Create the text object in model space
  Set textObj = ThisDrawing.ModelSpace.AddText(textString, insertionPoint, height)

  ' Change the value of the Height to 1
  textObj.height = 1
  textObj.Update
End Sub

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )

GMT+8, 2024-6-27 16:19

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部