C ++中的文本渲染 [英] Text rendering in C++

查看:75
本文介绍了C ++中的文本渲染的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以建议我一些C ++库/框架或在我们的计算机上呈现文本的方法吗?以下是我尝试过的选项,对我不起作用.

1.SDL.使用TTF渲染.
TTF字体占用大量内存.我的内存限制是40 MB.

2.SDL.使用位图字体渲染.
这在某种程度上可以工作.但是它不能用于阿拉伯语,希伯来语等.如果缩放,它的质量也会下降.它会开始像素化.

3.SDL.通过rtf文件呈现.
维护和更新rtf文件超出了范围.我将拥有约1000个rtf文件.

4.Pango/Gecko引擎.
我需要在GCC34/G ++ 34(Linux)上完成编译的Windows XP,Red Hat 7.3和Fedora Core 8 OS解决方案.

我正在寻找的解决方案是X和帧缓冲系统.

另外,如果使用我尝试的方法可以完成任何操作,也请让我知道.

预先谢谢您;)

Could anybody suggest me some C++ library/framework or a way to render text on our machines .Following are the options which I have tried out and do not work for me .

1.SDL .Rendering using TTF .
TTF fonts consume a lot of memory .My memory restriction is 40 MB .

2.SDL .Rendering using bitmap font .
This works to some extent .However it cant be used for arabic,hebrew etc .Also its quality degrades if we zoom .It starts pixelating .

3.SDL .Rendering through rtf files .
Maintaining and updating rtf files is out of scope .I will have around 1000 rtf files.

4.Pango/Gecko Engine.
I need the solution for Windows xp, Red Hat 7.3 and Fedora Core 8 OS with compiling done on GCC34 / G++34 (Linux).

Solution I am looking is for , X and frame buffer systems both.

Also if there is anything which can be done using the methods tried by me ,then too please let me know .

Thank you in advance ;)

推荐答案

如果要通过Windows或已经拥有自己的窗口管理器的任何Linux创建应用程序,则不应处理前端问题":thay是窗口管理器本机API的一部分.
(并且您的应用程序不应该安装字体:这是OS发行问题).

诸如FLTK,WxWidget,QT等GUI库已经具有一定的抽象级别,可让您使用通用模型渲染文本,并调用基础平台的相应API.

Pango/Geko是一种解决方案,可以让您在系统中绘制字体(应该是纯光栅,而不是文本感知),并且可以移植到Windows,但这是功能的重复!
If you are creating an application over Windows or whatever Linux that already have its own window manager, you should not deal with the "front problem": thay are part of the native API of the window manager.
(and should not your application to install fonts: that''s an OS distribution problem).

A GUI library like FLTK, WxWidget, QT, ... has already a level of abstraction that lets you render text with a common model, calling the appropriate API of the underlying platform.

Pango/Geko are solution that allow you to draw yourself your fonts in your system (that is supposed a pure raster, not text-aware) and it is portable also to windows, but it is a duplication of functionality!


这篇关于C ++中的文本渲染的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆