truetype字体怎么转换成普通字体,如何将位图字体(.FON)转换为truetype字体(.TTF)?...

本文档详细介绍了如何将.FON字体转换为.TTF字体以解决打印问题。通过使用FontForge和Autotrace工具,手动进行一些修正,最终得到可缩放的TrueType字体。首先在PortableUbuntu中安装FontForge和Autotrace,然后导入.FON字体,将其转换为BDF格式,再用Autotrace创建矢量图形。最后,手动调整字符并生成.TTF字体。
摘要由CSDN通过智能技术生成

My program (win32, Delphi) needs to display special chars in some columns of a table. To do that I use a special font for those columns. I got the font from my client. It is a .FON font. It works good on the screen but I often get problems as soon as I want to use it to print something.

I would like to convert this .FON font into to truetype font (.TTF) to avoid the problems. I don't care if the font does not scale good. I should just looks exactly the same when used on the screen with the same size as the default size of the original font.

Do someone know a way to do that?

(It don't necessary need a source code solution. The font won't change. It's enough if I find a tool to do it)

Edit: Ideal would be to get a truetype font where each pixel of the original font is converted into a vectorial black square (I tested by redrawing a few chars manually, it would works as I want).

Edit 2, solution used: Using FontForge + Autotrace and then making corrections manually I was able to get a vector font that follow the outline of the pixels of the bitmap font. This vector font scales somewhat better than the original font and solve my printing problems. See accepted post for details.

But I'm still interested if someone knows a fully automated solution.

解决方案

Use FontForge + Autotrace then make some corrections manually.

First integrate Autotrace in Fontforge, see Autotracing bitmaps in FontForge. Here is how I have done it, as I wasn't able to use the win32 version of FontForge:

Download, unzip and start Portable Ubuntu Tres. It's a special linux version that works under Windows!

Choose System->Administration->Add/Remove Applications, search for FontForge and install it (administrator password is 123456). I got FontForge version 20090622 installated.

Download autotrace-0.31.1.tar.gz from http://autotrace.sourceforge.net/index.html#download and copy it in your home directory in Portable Ubuntu.

In Portable Ubuntu choose Applications->Accessories->Terminal to compile and install autotrace:

sudo bash (password is 123456)

gunzip autotrace-0.31.1.tar.gz

tar xf autotrace-0.31.1.tar

cd autotrace-0.31.1

./configure

make

make install

Then convert your font:

Start FontForge in Portable Ubuntu and open the .FON font.

Save your font as a .BDF font (Loading a .FON file as background didn't work for me so I had to convert the font first): File->Generate Fonts and choose BDF as format.

Create a new font and import the BDF Font as background font: File->Import and don't forget select "As Background".

Select all characters and start an autotrace while holding the shift key so that you can enter parameters for autotrace. I used following parameters, which improved the recognition of the outline of the pixels but I didn't found the perfect parameters:

-corner-surround=1 -line-threshold=10

Correct the chars manually using mostly the function "Add a curve point".

Activating View->Show->Almost Horizontal/Vertical Lines makes the work much easier.

Generate a truetype font: File->Generate Fonts and choose truetype as format.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值