如何在 PHP 中使用 FDPF 给文本加下划线?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13598384/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I underline text using FDPF in PHP?
提问by Scott
I'm trying to make my text underlined in FPDFbut it seems to be impossible... I'm not using HTML. I'm using an DejaVuunicode font, which supports UTF-8, and also its my first time working with the FPDF.
我试图让我的文本加下划线,FPDF但这似乎是不可能的......我没有使用 HTML。我正在使用DejaVu支持 UTF-8的unicode 字体,这也是我第一次使用 FPDF。
Is that even possible? Please give me some solutions.
这甚至可能吗?请给我一些解决方案。
采纳答案by Thomas Lauria
Try this :
尝试这个 :
$fpdf->SetFont('Dejavu','U'); //Where "U" means underline.
See also (in german) http://www.fpdf.de/funktionsreferenz/?funktion=SetFont
另见(德语)http://www.fpdf.de/funktionsreferenz/?funktion=SetFont
See also (in english) http://www.fpdf.org/en/doc/setfont.htm

