Dompdf URDU font issue - codeigniter

please any one help, how i print URDU/pakistani fonts on DOMPDF? i used CSS #font-face rules , but not working, show these characters "?????? ????"
Set character encoding to utf 8 but not working, i used following method
Hindi Font with DOMPDF in Codeigniter
https://github.com/dompdf/dompdf/wiki/About-Fonts-and-Character-Encoding?fbclid=IwAR1OKwTpmClLL0SsS_sIB2kehHGzXLSH6OHft1ahMIfRRito_BTLC4wPORM

Related

Html Table Caption problem in conversion to pdf

I am converting html to pdf by using HtmlConverter.convertToElements and then adding the iElements to the document. And it works with every html element except a caption element directly inside a table.
<table>
<caption>Some text</caption>
... TRs with TDs here ...
</table>
The error is
java.lang.IllegalStateException: FontProvider and FontSet are empty.
Cannot resolve font family name (see ElementPropertyContainer#setFontFamily)
without initialized FontProvider (see RootElement#setFontProvider).
I have identified that the error occurs at com.itextpdf.layout.renderer.TextRenderer.resolveFonts when the FontProvider has no fonts. It does not help to explicitly define the font for caption in a style and all other elements use the same font just fine. If I hide the caption by using display: none; everything else (h3, p, div, th, td) renders correctly in the pdf and uses the fonts just fine. It feels like something is wrong in iText, but a work-around would be welcome in the meantime.
I am using Linux, Java and itext7-core 7.2.3 and html2pdf 4.0.3

Dompdf UT8 with database records with accents

I have a problem with utf8 with my stored data with dompdf for laravel: https://github.com/barryvdh/laravel-dompdf
My column collation is set to
utf8mb4_unicode_ci
In my html file I use:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
So when I write in my html file : éééé and I generate the PDF it's file but when I display my stored data the accents are displayed by : ?
In my config/dompdf.php
I have set :
"DOMPDF_UNICODE_ENABLED" => true,
"DOMPDF_PDF_BACKEND" => "CPDF",
What am I doing wrong? The problem only come from my stored data.. Hope someone could help thanks a lot in advance.
When I display my blade page without dompdf on firefox it's also really strange I get spaces between the accents :
But with Chrome all is fine ..
Also when i trie to pass a variable with a accent to my dompdf view the content of the variable is not display when there is an accent
$fede = 'fé'; // not display
$fede = 'fe'; // is displayed as well..
I had same issue before , and i changed many things but i couldn't make it to work , then i switched to niklasravnsborg/laravel-pdf and it worked like sharm , give it a try and see

CKEDITOR replacing the span tag with the font

Using a version 3 ckeditor I have problems copying and pasting replacing the span tag with the font tag as I can fix the problem?
First of all, please upgrade your editor because version 3 is no longer developed and doesn't work in browsers like IE11 and Egde.
Once editor is upgraded, you can replace span tag with font tag by: removing Font plugin and extending ACF with font tag plus its attributes like face, size and align.
var editor = CKEDITOR.replace( 'editor1', {
extraAllowedContent : 'font[face,size,align] ',
removePlugins : 'font'
});
Links which might help in upgrade process:
https://sdk.ckeditor.com/
https://docs.ckeditor.com/#!/guide
ACF links:
http://docs.ckeditor.com/#!/guide/dev_acf
http://docs.ckeditor.com/#!/guide/dev_advanced_content_filter
http://docs.ckeditor.com/#!/guide/dev_disallowed_content
http://docs.ckeditor.com/#!/api/CKEDITOR.filter-method-addTransformations
http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-allowedContent
http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-extraAllowedContent
Angelo
You can check this page https://docs.ckeditor.com/#!/guide/dev_acf
Probably you should add to your CKEditor configuration something like
config.extraAllowedContent = 'span[*]{*};'
This will allowed span tag with all attribute and css property

Unnatural bold Chinese characters in Wordpress

Some Chinese characters on my website renders in Bold. I have no styles attached or elements within the <p> element. This happends only on FireFox
I tried setting content-language to
<meta content="ch" http-equiv="content-language">
and also tried adding the font SimSun as mentioned here
Can you guys please check this and let me know your thoughts here

#font-face unicode-range attribute

In some html documents I'm using webfonts for only a couple of words. Performance-wise loading a complete font-file seems wasteful. This is where the unicode-range parameter of the #font-face declaration comes in:
http://www.w3.org/TR/css3-fonts/#unicode-range-desc
With it I supposedly can define what characters of the font-file to load, thus improving performance greatly.
But I just can't get it to work. And the odd thing is that it diplays all the characters in firefox, and it fails to load the font in safari just if I include the unicode-range parameter in my declaration.
Any help would be appreciated, below is the html I was testing it with:
<!doctype html>
<html lang="en">
<head>
<style text="text/css">
#font-face {
font-family: 'dream';
src: url(Fonts/Digital-dream/DIGITALDREAM.ttf) format("truetype");
unicode-range: U+FF21;
}
*{
font-family:dream;
font-weight:normal;
}
</style>
</head>
<body>
<p>ASDWEWQDSCF</p>
</body>
</html>
You are misunderstanding the purpose of that value. From that page:
This descriptor defines the range of Unicode characters supported by a given font
So this isn't the glyphs (or characters) to download, this is actually telling the browser what characters are in the font so that the browser can determine if its even worth downloading the font in the first place. If the text being styled isn't in the given unicode-range then the font won't be downloaded.
Example XIII on the page you reference shows a great example. Imagine 3 #font-face rules that share the same font-family attribute. The first rule, however, points to a giant 4.5MB TTF file that has every possible glyph needed. The second rule lists a much smaller 1.2MB TTF but says to only use it only if all of the characters fit into the Japanese glyph range. The third rule lists a very small 190KB file that can be download if the text being styling is only roman.

Resources