Set appropriate tt font that supports CJK

The actual font should be discussed. This one is OSS and works well:
https://github.com/adobe-fonts/source-han-code-jp
This commit is contained in:
Juergen Spitzmueller 2024-09-14 14:46:29 +02:00
parent 7340fe5d65
commit 52157c9318
2 changed files with 22 additions and 20 deletions

View File

@ -13,7 +13,7 @@
\fontencoding auto \fontencoding auto
\font_roman "lmodern" "IPAexMincho" \font_roman "lmodern" "IPAexMincho"
\font_sans "default" "IPAexMincho" \font_sans "default" "IPAexMincho"
\font_typewriter "default" "default" \font_typewriter "default" "Source Han Code JP"
\font_math "auto" "auto" \font_math "auto" "auto"
\font_default_family default \font_default_family default
\use_non_tex_fonts false \use_non_tex_fonts false
@ -189,11 +189,7 @@ CJK
\noindent \noindent
! !
Package inputenc Error: Package inputenc Error:
Unicode char Unicode char 中 (U+4E2D)
\family sans
\family default
(U+4E2D)
\end_layout \end_layout
\begin_layout LyX-Code \begin_layout LyX-Code

View File

@ -1,27 +1,26 @@
#LyX 2.4 created this file. For more info see https://www.lyx.org/ #LyX 2.4 created this file. For more info see https://www.lyx.org/
\lyxformat 573 \lyxformat 620
\begin_document \begin_document
\begin_header \begin_header
\save_transient_properties false \save_transient_properties false
\origin unavailable \origin unavailable
\textclass scrbook \textclass scrbook
\use_default_options false \use_default_options false
\maintain_unincluded_children false \maintain_unincluded_children no
\begin_local_layout
\end_local_layout
\language japanese \language japanese
\language_package default \language_package default
\inputencoding utf8 \inputencoding utf8
\fontencoding auto \fontencoding auto
\font_roman "lmodern" "IPAexMincho" \font_roman "lmodern" "IPAexMincho"
\font_sans "default" "IPAexGothic" \font_sans "default" "IPAexGothic"
\font_typewriter "default" "default" \font_typewriter "default" "Source Han Code JP"
\font_math "auto" "auto" \font_math "auto" "auto"
\font_default_family default \font_default_family default
\use_non_tex_fonts false \use_non_tex_fonts false
\font_sc false \font_sc false
\font_osf false \font_roman_osf false
\font_sans_osf false
\font_typewriter_osf false
\font_sf_scale 100 100 \font_sf_scale 100 100
\font_tt_scale 100 100 \font_tt_scale 100 100
\use_microtype false \use_microtype false
@ -71,12 +70,14 @@
\suppress_date false \suppress_date false
\justification false \justification false
\use_refstyle 0 \use_refstyle 0
\use_formatted_ref 0
\use_minted 0 \use_minted 0
\use_lineno 0
\notefontcolor #0000ff \notefontcolor #0000ff
\branch OutDated \branch OutDated
\selected 0 \selected 0
\filename_suffix 0 \filename_suffix 0
\color #f5fae7 \color #f5fae7 #0a0518
\end_branch \end_branch
\index 索引 \index 索引
\shortcut idx \shortcut idx
@ -97,9 +98,13 @@
\tablestyle default \tablestyle default
\tracking_changes false \tracking_changes false
\output_changes false \output_changes false
\change_bars false
\postpone_fragile_content false
\html_math_output 0 \html_math_output 0
\html_css_as_file 0 \html_css_as_file 0
\html_be_strict true \html_be_strict true
\docbook_table_output 0
\docbook_mathml_prefix 1
\end_header \end_header
\begin_body \begin_body
@ -109,16 +114,18 @@ False positive error:
\end_layout \end_layout
\begin_layout Standard \begin_layout Standard
A listings inset in a Japanese document (both, platex and CJK) resulted A listings inset in a Japanese document (both,
in a platex and CJK) resulted in a
\end_layout \end_layout
\begin_layout LyX-Code \begin_layout LyX-Code
Encoding.cpp (251): Uncodable character in latexString! Encoding.cpp (251):
Uncodable character in latexString!
\end_layout \end_layout
\begin_layout Standard \begin_layout Standard
error messages in the terminal, even if the content is pure ASCII and error messages in the terminal,
even if the content is pure ASCII and
\end_layout \end_layout
\begin_layout Standard \begin_layout Standard
@ -126,8 +133,7 @@ the output is fine.
\end_layout \end_layout
\begin_layout Standard \begin_layout Standard
This is because it wants to put the translated listingsname into the preamble This is because it wants to put the translated listingsname into the preamble but does not believe it can be encoded there...
but does not believe it can be encoded there...
\end_layout \end_layout
\begin_layout Standard \begin_layout Standard