从字体文件中获取图形信息。如何开发类似于PDFView字体解析器的字体解析器?

发布于 2024-08-24 19:02:12 字数 638 浏览 6 评论 0原文

我正在尝试使用 C# 将文本转换为图形。

我的输入是字符串,输出是带有输入文本的位图。

经过大量搜索,我找到了一些方法来做到这一点,我发现了一些使用这种技术的技术。 例如,在创建验证码时,我们必须打印位图中的字符。

但为此我应该在我的窗口中安装该字体。

如果不安装字体,我无法执行此类操作。

我有 .ttf 文件,但我不想安装它,因为我对该字体的工作只是临时的。

有什么方法可以通过提供字符来提取字体的图形信息吗?

我还找到了字体解析器代码 http://swinglabs.java.sun.com/hudson/job/PDFRenderer%20Weekly%20Build/javadoc/com/sun/pdfview/font/package-summary.html

任何人都可以请告诉我如何使用 c#.Net 开发类似的东西?

或者

从哪里可以获得解析字体的算法?

I am trying to convert text into graphics using c#.

My input is character string and output is bitmap with the input text.

After lot of search I found some ways to do it, I found some techiques which uses this kind of techinque.
For Example While creating Captcha, we have to print the character in the bitmap.

But for that I should have the font installed in my windows.

I can not perform such operation without installing the font.

I have .ttf file with me but I dont want to install it because my work for that font is temporary only.

Is there any way where I can extract out the Font's graphical information by providing the Character?

I have also found font parser code http://swinglabs.java.sun.com/hudson/job/PDFRenderer%20Weekly%20Build/javadoc/com/sun/pdfview/font/package-summary.html

Can anyone please provide me how to develpo similar thing using c#.Net?

Or

From where can I get the algorithm to parce font?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

飘过的浮云 2024-08-31 19:02:13

您可以使用 PrivateFontCollection 类来使用 Windows 中未安装的字体。

无需自己解析它们。

You can use the PrivateFontCollection Class to use fonts that are not installed in Windows.

No need to parse them yourself.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文