Tag: 字形

WPF:字形从右到左的文本呈现

我想使用Glyph来呈现从右到左的语言文本(例如阿拉伯语或混合英语和阿拉伯语)。 我正在使用此代码: Typeface typeface = new Typeface(new FontFamily(“Arial”), FontStyles.Italic, FontWeights.Normal, FontStretches.Normal); GlyphTypeface glyphTypeface; if (!typeface.TryGetGlyphTypeface(out glyphTypeface)) throw new InvalidOperationException(“No glyphtypeface found”); string text = “Hello , سلام”; double size = 40; ushort[] glyphIndexes = new ushort[text.Length]; double[] advanceWidths = new double[text.Length]; double totalWidth = 0; for (int n = 0; n < text.Length; n++) { […]

确定指定字体的确切字形高度

我经常搜索并尝试了很多,但我找不到合适的解决方案。 我想知道有没有办法确定指定字体的确切字形高度 ? 我的意思是在这里,当我想确定DOT字形的高度时,我应该收到较小的高度而不是带有填充或字体大小的高度。 我已经找到了确定精确字形宽度的解决方案(我已经使用了第二种方法),但它不适用于高度。 更新:我需要.NET 1.1的解决方案