
Hi everybody.
I want to display the Vietnamese language but it is currently faulty, I want to use font time new roman.
Can anyone help me?
Thanks very much!
You need to do the following:
1, Save the "load_font.php" file from https://raw.githubusercontent.com/dompdf/utils/master/load_font.php" to the root of the project.
2, In root project, run command:
php load_font.php font_family [n_file [b_file] [i_file] [bi_file]]
With:
font_family: the name of the font
n_file: the path to the normal variant TTF file
i_file: the path to the italic variant TTF file
b_file: the path to the bold variant TTF file
bi_file: the path to the bold-italic variant TTF file
Eg: Font Times New Roman available on Window
(using gitbash on Window 10)
php load_font.php 'Times New Roman' /c/Windows/Fonts/times.ttf /c/Windows/Font s/timesbd.ttf /c/Windows/Fonts/timesi.ttf /c/Windows/Fonts/timesbi.ttf
Or you can use the @font-face directive in your CSS. Be sure the font you load supports Vietnamese.
thanks!
Working example:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="http://fonts.googleapis.com/css2?family=Noto+Sans&display=swap" rel="stylesheet">
<link href="http://fonts.googleapis.com/css2?family=Amiri&display=swap" rel="stylesheet">
</head>
<body>
<h2>Noto Sans</h2>
<p style="font-family: 'Noto Sans', sans-serif;">袚芯褉写械泄 袘械谢褟械胁</p>
<h2>Amiri</h2>
<p style="font-family: 'Amiri', serif;">毓賳賵丕賳</p>
</body>
</html>
For Vietnamese pick the right font here: https://fonts.google.com/?subset=vietnamese