英文:
I have tamil font in my Laravel Blade View, It is working perfectly in Web page but not in pdf, When I download pdf the tamil words shuffled
问题
I used Tamil font Noto Sans but when I am trying to generate pdf, the tamil words mismatch in pdf.
This is What I wrote in web page "முகவரி", but in pdf it generates like this "மீகவரி".
This is my head tag of my blade view in laravel:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
//I also tried akruti1.ttf by downloading it and added it to my public directory but it does not load in my project::
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+Tamil&display=swap" rel="stylesheet">
<title>Proforma Report</title>
<style>
body {
font-family: 'Noto Sans Tamil', sans-serif;
}
</style>
//This is my body tag:
<div>
<label>1. விண்ணப்பதாரர் பெயர்<br>
Name of the Applicant</label>
</div>
<div>
<textarea></textarea>
</div>
英文:
I used Tamil font Noto Sans but when I am trying to generate pdf, the tamil words mismatch in pdf.
This is What I wrote in web page "முகவரி", but in pdf it generate like this "மீகவரி".
This is my head tag of my blade view in laravel:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
//I also tried akruti1.ttf by downloading it and added on my public directory but it does not load in my project::
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+Tamil&display=swap" rel="stylesheet">
<title>Proforma Report</title>
<style>
body {
font-family: 'Noto Sans Tamil', sans-serif;
}
</style>
//This is my body tag:
<div>
<label>1. விண்ணப்பதாரர் பெயர்<br>
Name of the Applicant</label>
</div>
<div>
<textarea></textarea>
</div>
答案1
得分: 0
在您的Blade中,请尝试修改head标签部分如下:
<head>
<title>Proforma Report</title>
<style>
@font-face {
font-family: 'Noto Sans Tamil';
font-style: normal;
font-weight: 400;
src: url('{{ public_path('fonts/NotoSansTamil-Regular.ttf') }}') format('truetype');
}
body {
font-family: 'Noto Sans Tamil', sans-serif;
}
</style>
</head>
英文:
In your Blade, try modifying the head tag section to the following.
<head>
<title>Proforma Report</title>
<style>
@font-face {
font-family: 'Noto Sans Tamil';
font-style: normal;
font-weight: 400;
src: url('{{ public_path('fonts/NotoSansTamil-Regular.ttf') }}') format('truetype');
}
body {
font-family: 'Noto Sans Tamil', sans-serif;
}
</style>
</head>
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论