TFT印地文字体生成的帮助 [英] Help for TFT hindi font generation

查看:252
本文介绍了TFT印地文字体生成的帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究TFT.我应该显示印地文字体.如何去做.它不是英文字体.当我在互联网上进行研究时,发现它遵循的技术是unicode.这是什么,如何开始.

I''m working on TFT. I''m supposed to display hindi fonts. How to go for it. It is not so as english fonts. when i researched in internet, i found that the technique it follows is unicode. what is it, how to start for it. Kindly help.

推荐答案

问题是什么,很难读懂Unicode,而几乎所有东西都在使用它?

http://en.wikipedia.org/wiki/Unicode [ http://unicode.org/ [ ^ ].

您的个人资料告诉我们您来自印度.我永远无法理解印度的软件开发人员(!),他们甚至都不知道没有印地语字体"之类的东西.这样的事情不可能存在,因为现代印地语只是使用 Devanagari脚本的几种语言之一,特别是包括梵语在内.而且这个脚本比流行的还多.几乎每个现代系统都默认支持.

我不知道还有什么其他的帮助,因为您没有分享您真正需要实现的目标,但是最有可能的是,这很琐碎.如果您遇到任何问题,请随时提出更具体的问题.

关于梵文,印地语和其他语言及相关问题,我认为最富有的印度文化,自己的本土文化和邻国的文化应得到更多的尊重.

—SA
What''s the problem, hard to read about Unicode, while nearly everything uses it?

http://en.wikipedia.org/wiki/Unicode[^],
http://unicode.org/[^].

You profile tells us that you are from India. I can never understand Indian software developers (!) who don''t even know that there is no such thing as "Hindi font". Such thing cannot exist, because modern Hindi is just one of the several languages using Devanagari script, notably, including Sanskrit. And this script is more than popular; it is supported by default by nearly every modern system.

I don''t know how else to help as you did not share what exactly you need to achieve, but most likely, this is something quite trivial. If you face any problems, please feel free to ask more specific questions.

As to Devanagari, Hindi and other languages and related matter, I think that the richest Indian culture, your own native culture and the culture of your neighbors deserve way more respect.

—SA


好吧,Unicode是一种可以表示许多不同字符的方法.英语没有太多字符-0-9(10)加上a-z(26)加上A-Z(26),总共62个字符.

在ASCII文本中,每个字符都由8位字符代码表示-最多允许256个不同的字符.因此,英文数字和字母消耗了这些字符中的62个,而符号/线条图字符/控制代码则组成了256个字符集中的其余字符.


不幸的是,这种编码方案不能代表在非拉丁语言中可能找到的所有不同字符-例如中文,日语,阿拉伯语,北印度语字符.

为了解决此问题,决定每个字符至少应由16位表示-至少应至少包含65536个字符.

这些(至少)2字节长的字符代码用于组成Unicode字符集.好吧,至少可以这样说.



为了在屏幕上表示位图字体,我们必须将每个字符的图片"存储在数组中-字体.然后,我们将每个字母的字符代码用作该数组(字体)的索引.

要完成此任务,我可以看到两个常规选项.

1)查找并下载位图的北印度语字体.
2)使用计算机上已安装的字体来自己创建一个.

要执行第2个操作,您有很多选择.您可以选择使每个字符的位图具有相同的宽度/高度,也可以选择使每个字符的位图足够大以容纳所需的位.例如,以字母"i"和"w"或.''和& "O"-每个字符的宽度和高度都不同.

使字符位图都具有相同的大小要简单得多.如果每个位图都足够大以容纳其代表的字符,则看起来更好.

在第一种情况下,您可以决定16x16足够大以表示每个字符.您只需要(字体中的数字字符)* 16x16位图

在第二种情况下,您需要字体中的每个字符都同时包含(1)位图和(2)一些大小信息.


如果您是在Windows上进行编程,则可以使用 ^ ]函数,指定DT_CALCRECT标志.如果您要遍历所有想要表示的字符,则可以一个一个地获得所需的大小,绘制该字符,然后复制char并将其保存到磁盘.

自从我上次明确处理位图字体以来已经15年了,那时我将它们从DOS的VGA BIOS中删除.我希望我的记忆足够清晰,可以为您提供一些指导和起点. :)
Well, Unicode is a method by which many, many different characters may be represented. The english language does not have very many characters - 0-9 (10) plus a-z (26) plus A-Z (26) for a total of 62 characters.

In ASCII text, each character is represented by an 8bit character code - this allows for up to 256 distinct characters. So, english numbers and letters consume 62 of these characters and symbols/line drawing characters/control-codes make up the remaining characters in the set of 256.


Unfortunately, this encoding scheme does not represent all of the different characters that may be found in non-Latin based languages - e.g Chinese, Japanese, Arabic, Hindi characters.

To solve this problem, it was decided that each character should be represented by at least 16 bits - allowing for a minimum of at least 65536 characters.

These (at least) 2-byte long character codes are used to make up the Unicode character set. Well, at least roughly speaking, anyway.



In order to represent a bitmapped font on a screen, we must store ''pictures'' of each character in an array - a font. We then use the character code for each letter as an index into that array(font).

To complete this task, I can see two general options.

1) Find and download a bitmapped Hindi font.
2) Create one yourself, using the fonts already installed on your machine.

To do number 2, you have a number of options. You may choose to make each character''s bitmap the same width/height, or you may choose to make each character''s bitmap just big enough to hold the required bits. Take for example the letters ''i'' and ''w'', or ''.'' & ''O'' - each of these characters are a different width and height.

It is much simpler to make the character bitmaps all the same size. It looks better if each bitmap is just large enough to hold the character that it represents.

In the first case, you may decide that 16x16 is large enough to represent each character. You just need (num chars in font) * 16x16 bitmap

In the second case, you need for each character in your font to hold both (1) a bitmap and (2) some size information.


If you are programming on Windows, you can get the minimum width and height of each charater by using the DrawText[^] function, specifying the DT_CALCRECT flag. If you loop through all of the characters that you wish to represent, you can one-by-one get the required size, draw the character then make a copy of the char and save it to disk.

It''s been over 15 years since I last dealt with bitmapped fonts explicitly, at which time I was plucking them out of the VGA bios in DOS. I hope that my memory is clear enough to give you some direction and a place to start. :)


你好enhzflep,
感谢您的回答,我想给您概述我应该做的任务.我的任务是在TFT屏幕上显示印地文文本,TFT控制器是SSD1963.当我使用英文字体时,我为所有字母[小写字母(a-z),大写字母(A-Z),0-9和所有特殊字符]下载了一个const数组.对于此const数组,我编写了一个函数,该函数将读取所有这些字符数组.当我在键盘上键入字符"A"时,它将从我创建的字体数组中读取,该数组与字母"A"的ascii值匹配.

现在在相同的情况下,我应该在TFT屏幕上显示印地文文本,例如,当我输入字母"a","aa","ka","kaa"时,应该显示相应的印地文字母.我是这种概念的新手.因此,当我在此上进行研发时,我发现了称为"Unicode"的概念.

我可以获得与字体一样的帮助吗?我搜索了很多,但找不到.我也有bipmap到数组转换器软件,但是问题是,如何映射用我在键盘上键入的字母创建的位图数组? (即,它应与我输入的英文字母的ascii值匹配).请帮忙.
hello enhzflep,
Thanks for your answer, I want to give you an overview of the task that I''m supposed to do. My task is to display hindi text on TFT screen,TFT controller is SSD1963. When i was working with english fonts, i downloaded a const array (in C) for all the alphabets [lower case letters (a-z), upper case letters (A-Z), 0-9 & all special characters]. For this const array, i wrote a function, wherein it would read all those characters arrays. When I typed a character ''A'' on keyboard, it would read from the font array that I had created, which would match with the ascii value of the letter ''A''.

Now in the same scenario, I''m supposed to display hindi text on TFT screen, when for example I would type letter ''a'',''aa'', ''ka'',''kaa'' it should display corresponding hindi letter. I''m new to this kind of concept. So when i was doing R & D on this I found out about the concept called, "Unicode".

Can I get any help wherein I can get those font arrays, same as I have for english fonts? I searched lots but not able to find them. I also have the bipmap to array converter software, but the problem is, how to map the bitmap arrays that are created with the letters that I type in keyboard? (i.e., it should match with the ascii values of the english letters that I type). Kindly help.


这篇关于TFT印地文字体生成的帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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