Comments (4)
I did some work on fixing this with the addition of a config_fonts.php file in your dw2pdf template. The format of it is describe on the mPDF site; for example:
<?php
$fontdata = array(
'gillsans' => array(
'R' => 'GIL_____.ttf',
'B' => 'GILB____.ttf',
'I' => 'GILI____.ttf',
'BI' => 'GILBI___.ttf',
),
);
You also need to define _MPDF_SYSTEM_TTFONTS
in conf/local.protected.php
to be the path of your font directory.
from dokuwiki-plugin-dw2pdf.
Thank you samwilson.
I exchanged action.php by yours and set up _MPDF_SYSTEM_TTFONTS in mpdf/config_fonts.php - indeed I cannot find any file named local_protected.php in conf/ (and anywhere else...) in my install (latest DW2PDF version in DWplugin)!?
But it still doesn't work, fonts embed in the pdf are only DejaVu... and don't support any CJK (all Japanese rendered as squares). I tried again to setup config_fonts.php by enabling CJK array fonts, installed Sun-ExtA & B ttf in mpdf/ttfonts... without any success.
Could you help me out for the settings to apply?
I've also tried another version of DW2PDF, the fork by Michitux, which is rendering well (using WenQuanYiZenHei font) for the first 381 characters, then squares reappeared, see here https://forum.dokuwiki.org/thread/9819
Any other idea?
Thanks
from dokuwiki-plugin-dw2pdf.
I'm sorry it's not working. :(
You need to create conf/local.protected.php
if it doesn't exist, and in it put:
define('_MPDF_SYSTEM_TTFONTS', '/path/to/your/fonts/directory');
If the example I have above, the files GIL_____.ttf
, GILB____.ttf
, etc. are in that directory. You should change these in the config_fonts.php
file (in your dw2pdf template directory) for whatever your font files are called (for Regular, Bold, Italic, and Bold Italic).
from dokuwiki-plugin-dw2pdf.
Ok thanks,
I've made all of these changes and tried lot of fonts but even it's not working for me (I was just able to force a font set - sun-exta & b - by adding them on the array at $this->sans_fonts at the end of config_fonts.php, but the result was a bit ugly. Indeed sun-exta & b fonts were also used for latin text).
Finally I've used the fork by Michitux and changed the setting of useAdobeCJK (true instead of false) in mpdf/config.php
Thanks for your help
from dokuwiki-plugin-dw2pdf.
Related Issues (20)
- font-size Option in Configuration Manager do not work HOT 6
- Feature Request: Add template dropdown to PageMenu-Button HOT 1
- Error 504 - Gateway Timeout with page width at 100% HOT 15
- Local QR code generation HOT 1
- Unable to decompress the downloaded file HOT 1
- "Undefined array key" error message when exporting page with interwiki links HOT 3
- cover.html page does not seem to respect mPDF styles HOT 4
- Multiline support of diagrams in PDF HOT 1
- bug (semi-solved): PDF creation hangs HOT 5
- install does not work! HOT 8
- Not downloadable with extension manager today (Jack Jackrum) HOT 1
- Error: Class "Mpdf\Mpdf" not found HOT 6
- SVG issue: TypeError: Unsupported operand types: string * float HOT 2
- Changing the orientation within one document, the cover.html page template is used again HOT 5
- Error: Call to undefined function Mpdf\Color\ctype_xdigit() HOT 2
- Struct data in DW2PDF produces unexpected results
- UTF8 characters not supported when exporting pdf document HOT 3
- Linebreaks are not respected
- lacks support for PHP 8.2 HOT 1
- Add digital signatures to PDF documents.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dokuwiki-plugin-dw2pdf.