dtjkl42086 2012-02-03 10:08
浏览 67
已采纳

在linux中列出可用字体[关闭]

I'm programming a custom bit of hardware (a media box) running a custom build of Linux (tangox 2.6.29.6-18-sigma #2 PREEMPT Tue Dec 20 14:00:43 UTC 2011 mips GNU/Linux) and need to find out what fonts are available on this system.

Globally, my task is to quiz a web service for some content and display it on the system (i.e. on the TV screen), but not all characters I receive from the "outside world" can be rendered via the font used by the media box. Fonts on the media box are outside of my control, as is the firmware - I have to get on with what I've got via the supported PHP API.

Question 1: How would I list all fonts available on the box, along with their supported character ranges? (We suspect that the font being used does not render some of the chars we need - so my issues can't be solved by just making sure everything is UTF8.)

I've tried:

xlsfonts (command not found)
/etc/X11/ (dir does not exist)
fc-list (command not found)

...none of the above helped.

I've located some fonts in:

ls -al /firmware/fonts

-rw-r--r--    1 root     root        42643 Dec 31  1969 verdana-108-subset.aaf
-rw-r--r--    1 root     root       236340 Dec 31  1969 verdana-25.aaf
-rw-r--r--    1 root     root       426097 Dec 31  1969 verdana-34.aaf
-rw-r--r--    1 root     root       696763 Dec 31  1969 verdana-44.aaf
-rw-r--r--    1 root     root       834851 Dec 31  1969 verdana-48.aaf
-rw-r--r--    1 root     root         1539 Dec 31  1969 webdings-30.aaf
-rw-r--r--    1 root     root         5517 Dec 31  1969 webdings-38.aaf
-rw-r--r--    1 root     root         4509 Dec 31  1969 webdings-49.aaf

But I want to be sure that there are no other fonts hidden somewhere around the system and used by the firmware.

Question 2: Once I know the character range I can display in, is there a fool-proof way to strip out everything outside that range (I can do that), but simplify some of the fancy characters (e.g. accented e) into their English counter-parts? And last but not least - does anyone know of an existing PHP library that would do most of this for me?

P.S. Sorry if this question is a bit too n00bish - I'm not a Linux guru and don't have an intimate understanding of fonts/encodings.

  • 写回答

1条回答 默认 最新

  • doujiaozhan4397 2012-02-03 10:14
    关注

    Answer for Q1.

    This

    xlsfonts (command not found)
    /etc/X11/ (dir does not exist)
    fc-list (command not found)
    

    doesn't work because xorg-xserver not installed. If it is planned then you have only console fonts on your box (surely you don't have X11 fonts if you don't have X11 (xserver) itself). To list console fonts use ls -l /usr/share/consolefonts (on most distributions).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?
  • ¥100 求三轴之间相互配合画圆以及直线的算法
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 自己瞎改改,结果现在又运行不了了