确定渲染到黑框左侧的字体部分?
我有一种字体 - 'Saginaw',在渲染时,字形的某些部分位于起始位置/框的“左侧”:
[此处图片] http://i.imgur.com/1lP3C.png
上面的片段是 Photoshop 中的字体..我做了一个“全选”来显示黑框..
我试图弄清楚偏移量/值是什么是 [在框外左侧呈现的 W 部分]
到目前为止,我一直在研究System.Windows.Media.GlyphTypeFace 它有很多有趣的好处,包括 AdvancedWidths、LeftSideBearings、DistancesFromHorizontalBaselienToBlackBottom 等。
但是,我不太明白如何应用我的值我从字体中看到计算与该偏移量相对应的值。
最后,我尝试获取此字体元数据并在 Flex RichEditableTextArea 中渲染字体/文本,其中字体的弯曲左侧被切断:
[图片] http://i.imgur.com/Hjm7V.png
我在 Flex TLF 中还没有看到任何可以让我查看字体数据部分的内容。
[我确信它可能只是对我隐藏]
通过实验,我发现我可以在 RichEditableTextArea 中设置填充来移动字体,然后在其内部呈现“切断”部分。
我希望找到字体/字形“左移”的数量;然后应用适当的填充进行补偿。
[或者,如果有人知道如何强制 RichEditableTextArea 渲染被切断的部分,那也可以!]
如果有人有任何见解,我将不胜感激!
——埃里克
I have a font - 'Saginaw' that when renders has some portion of the glyph to the 'left' of the starting position/box:
[Picture here]
http:// i.imgur.com/1lP3C.png
The above snip is of the font in Photoshop.. I did a 'select all' to show the black box..
I'm trying to figure out what that offset/value is [portion of the W rendered on the left outside the box]
Thus far, I've been delving through System.Windows.Media.GlyphTypeFace which has much interesting goodies, including AdvancedWidths, LeftSideBearings, DistancesFromHorizontalBaselienToBlackBottom, etc.
However, I don't quite grok how to apply the values I'm seeing from the font to calculate a value that corresponds to that offset.
In the end, I'm trying to take this font metadata and render the font/text up in a Flex RichEditableTextArea, where the curvy left hand side of the font is getting cut off:
[Picture Here]
http:// i.imgur.com/Hjm7V.png
I'd not seen anything yet in the Flex TLF that lets me peer at that part of the Font data.
[I'm sure it's probably just hiding from me]
Via experimentation I'd seen I can set the padding in the RichEditableTextArea to shift the font over, then it renders the 'cut off' portion inside itself.
I was hoping to find the amount of the font/glyph 'left shift'; then apply appropriate padding to compensate.
[Alternately, if someone knows how to force the RichEditableTextArea to render that portion that is getting cut off, that would work as well!]
If anyone has any insight I would be deeply grateful!
--Erik
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您确定 LeftSideBearings 不包含此内容吗?
这将为您提供所需的负数。
Are you sure that the LeftSideBearings doesn't cover this?
This should give you the number you need as a negative.