首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >GlyphRun中的renderingEmSize参数指定了什么?

GlyphRun中的renderingEmSize参数指定了什么?
EN

Stack Overflow用户
提问于 2012-12-04 09:15:24
回答 1查看 288关注 0票数 1

我正在尝试创建一个在GlyphRunDrawing中使用的GlyphRun实例,但是文档实在是太糟糕了,简直滑稽可笑。例如,参数renderingEmSize的描述如下:

代码语言:javascript
复制
renderingEmSizeType: System.Double
A value of type Double.

只是..。哇。

我知道字体中的" em“是什么(em破折号的宽度),但我不知道网格单位是什么。设备像素?与设备无关的像素?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-12-04 09:15:24

答案就在源代码中。感谢微软提供这个,如果他们要让眼睛出血的文档。

有趣的是,我们需要的所有信息都包含在GlyphRun.cs上的xml文档注释中。例如,renderingEmSize如下所示:

代码语言:javascript
复制
<param name="renderingEmSize">Font rendering size in drawing surface units (96ths of an inch).</param>

文件的其余部分同样注释良好,包括这段看似不合时宜但扣人心弦的内容:

代码语言:javascript
复制
/*
The default branch prediction rules for modern processors specify that forward branches
are not to be taken. If the branch is in fact taken, all of the speculatively executed code
must be discarded, the processor pipeline flushed, and then reloaded. This results in a
processor stall of at least 42 cycles for the P4 Northwood for each mis-predicted branch. 
The deeper the processor pipeline the higher the cost, i.e. Prescott processors.
Checking for multiple incorrect parameters in a method with high call count like this one can 
easily add significant overhead for no reason. Note that the C# compiler should be able to make 
reasonable assumptions about branches that throw exceptions, but the current whidbey
implemenation is weak in this regard. Also the current IBC tools are unable to add branch 
prediction hints to improve behavior based on run time information. Also note that adding
branch prediction hints increases code size by a byte per branch and doing this in every
method that is coded without default branch prediction behavior in mind would add an
unacceptable amount of working set. 
*/

可以在以下位置找到整个文件:GlyphRun.cs at webtropy

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13694611

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档