$fontDir = __DIR__ . '/fonts';
$customFont = $fontDir . '/COOPBL.ttf';
$fontMetrics = $dompdf->getFontMetrics();
$customFontFamily = $fontMetrics->getFont('Cooper Black', 'bold', $customFont);
$html = "
<!DOCTYPE html>
<style>
@font-face {
font-family: 'Cooper Black';
src: url('$customFont') format('truetype');
font-weight: 900%;
font-style: normal;
}
.coop {
font-family: 'Cooper Black';
}
I am using dompdf to generate pdf, but my custom font is not picking up. I want the fonts to pick up. Why is my custom font not picking up? Please help me. Please provide me a example, that works.
New contributor
user25159129 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.