LaTeX forum ⇒ Fonts & Character SetsWhat does nullfont mean?

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
annier
Posts: 16
Joined: Mon Sep 14, 2015 4:24 pm

What does nullfont mean?

Postby annier » Wed Sep 23, 2015 3:45 pm

Hi all,
I am using Texlive 2015 in Ubuntu 14.04. I want to print some chinese characters using Latex and the sample code is as following:
  1. \documentclass{book}
  2. \usepackage{CJK}
  3. %\usepackage{ccmap}
  4. \begin{document}
  5. \begin{CJK*}{GB}{song}
  6. \CJKindent
  7. 你好
  8. \end{CJK*}
  9. \end{document}


For things typed in English, the output appears without errors. When I type 你好 (ni hao = hello ), nothing appears on the pdf output i.e. pdf opens with blank space. The output log is attached herewith.
What should i do for the following message:
Missing character: There is no \94 in font nullfont!
[1{/usr/local/texlive/2015/texmf-var/fonts/map/pdftex/updmap/pdftex.map}

]



Yours Sincerely
Anil Kunwar
Attachments
cjk_indent.log
output_log
(11.43 KiB) Downloaded 79 times

User avatar
cgnieder
Site Moderator
Posts: 1988
Joined: Sat Apr 16, 2011 7:27 pm

Postby cgnieder » Wed Sep 23, 2015 8:27 pm

As far as I understand it the \nullfont is some kind of dummy font. from TeX by Topic:
TeX always knows a font that has no characters: the \nullfont. If no font has been specified, or if in math mode a family member is needed that has not been specified, TeX will take its characters from the nullfont. This control sequence qualifies as a fontdef token : it acts like any other control sequence that stands for a font; it just does not have an associated tfm file.


LaTeX doesn't the font metric file it needs. From your log:
  1. LaTeX Font Info: Try loading font information for C10+song on input line 6.
  2.  
  3. (/usr/local/texlive/2015/texmf-dist/tex/latex/cjk/texinput/GB/c10song.fd
  4. File: c10song.fd 2015/04/18 4.8.4
  5. )
  6. LaTeX Font Info: Try loading font information for C10+fs on input line 6.
  7.  
  8. (/usr/local/texlive/2015/texmf-dist/tex/latex/cjk/texinput/GB/c10fs.fd
  9. File: c10fs.fd 2015/04/18 4.8.4
  10. )
  11.  
  12. LaTeX Font Warning: Font shape `C10/song/m/n'
  13. (Font) in size <10> not available.
  14. (Font) Font shape `C10/fs/m/n'
  15. (Font) tried instead on input line 6.
  16.  
  17. ! Font C10/fs/m/n/10/01=gsfs1401 at 10.0pt not loadable: Metric (TFM) file not
  18. found.
  19. <to be read again>
  20. relax
  21. l.6 \CJKindent


Do you have the song font installed? (I haven't and I don't know how to do it…)

the sources may be helpful:

http://tex.stackexchange.com/q/147529/5049

http://tex.stackexchange.com/a/17637/5049

For me the following compiles:
  1. \documentclass{article}
  2. \usepackage{CJK}
  3.  
  4. \begin{document}
  5. \begin{CJK}{UTF8}{gbsn}
  6. 汉字
  7. \end{CJK}
  8. \end{document}
Clemens
------------------------------
chemmacros · chemformula · leadsheets · xsim

annier
Posts: 16
Joined: Mon Sep 14, 2015 4:24 pm

Postby annier » Thu Sep 24, 2015 9:31 am

Hi Clemens,
The following code is compiled successfully without error by the texmaker in my context
  1. \documentclass{book}
  2. \usepackage{CJK}
  3. %\usepackage{ccmap}
  4. \begin{document}
  5. %\begin{CJK*}{GB}{song}
  6. \begin{CJK*}{UTF8}{gbsn}
  7. \CJKindent
  8. 你好
  9. \end{CJK*}
  10. \end{document}

Then, is it related to the {song} font or {GB}? Apart from gbsn and gkai, the installation has mj,song etc. fonts. Also, when the above code is used for {GB} instead of {UTF8}, i.e. the same code above with the line
  1. \begin{CJK*}{GB}{gbsn}
instead of
  1. \begin{CJK*}{UTF8}{gbsn}
gives the output but a different character than the typed ones. Why is this happening?



Yours Sincerely
Anil Kunwar

User avatar
Johannes_B
Site Moderator
Posts: 3804
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Thu Sep 24, 2015 5:00 pm

You could use XeLaTeX or LuaLaTeX to access any font installed on your system (needs to contain the characters needed).
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

annier
Posts: 16
Joined: Mon Sep 14, 2015 4:24 pm

Postby annier » Fri Sep 25, 2015 10:35 am

Johannes_B wrote:You could use XeLaTeX or LuaLaTeX to access any font installed on your system (needs to contain the characters needed).

Hi Johannes,
Could you please elaborate on "needs to contain the characters needed"? I tried to open with LuaLaTeX and it showed blank space (without any error message).


Yours Sincerely
Anil Kunwar

User avatar
Johannes_B
Site Moderator
Posts: 3804
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Mon Sep 28, 2015 6:42 pm

A font usually constists of different glyphs, one for a capital A, one for a lower case a, and so on. If nobody added a glyph for a special code-point, Lua/XeTeX or any other program cannot display the glyph.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.


Return to “Fonts & Character Sets”

Who is online

Users browsing this forum: No registered users and 1 guest