Skip to content

Commit

Permalink
Update to 1.84
Browse files Browse the repository at this point in the history
  • Loading branch information
JanSlabon committed Aug 30, 2021
1 parent 6a83253 commit b0ddd9c
Show file tree
Hide file tree
Showing 12 changed files with 139 additions and 46 deletions.
4 changes: 4 additions & 0 deletions changelog.htm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
<body>
<h1>Changelog</h1>
<dl>
<dt><strong>v1.84</strong> (2021-08-28)</dt>
<dd>
- Fixed an issue related to annotations.<br>
</dd>
<dt><strong>v1.83</strong> (2021-04-18)</dt>
<dd>
- Fixed an issue related to annotations.<br>
Expand Down
4 changes: 2 additions & 2 deletions doc/index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>FPDF 1.83 Reference Manual</title>
<title>FPDF 1.84 Reference Manual</title>
<link type="text/css" rel="stylesheet" href="../fpdf.css">
</head>
<body>
<h1>FPDF 1.83 Reference Manual</h1>
<h1>FPDF 1.84 Reference Manual</h1>
<a href="__construct.htm">__construct</a> - constructor<br>
<a href="acceptpagebreak.htm">AcceptPageBreak</a> - accept or not automatic page break<br>
<a href="addfont.htm">AddFont</a> - add a new font<br>
Expand Down
8 changes: 4 additions & 4 deletions fpdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
/*******************************************************************************
* FPDF *
* *
* Version: 1.83 *
* Date: 2021-04-18 *
* Version: 1.84 *
* Date: 2021-08-28 *
* Author: Olivier PLATHEY *
*******************************************************************************/

define('FPDF_VERSION','1.83');
define('FPDF_VERSION','1.84');

class FPDF
{
Expand Down Expand Up @@ -1521,6 +1521,7 @@ protected function _putpage($n)
// Annotations
foreach($this->PageLinks[$n] as $pl)
{
$this->_newobj();
$rect = sprintf('%.2F %.2F %.2F %.2F',$pl[0],$pl[1],$pl[0]+$pl[2],$pl[1]-$pl[3]);
$s = '<</Type /Annot /Subtype /Link /Rect ['.$rect.'] /Border [0 0 0] ';
if(is_string($pl[4]))
Expand All @@ -1534,7 +1535,6 @@ protected function _putpage($n)
$h = ($this->DefOrientation=='P') ? $this->DefPageSize[1]*$this->k : $this->DefPageSize[0]*$this->k;
$s .= sprintf('/Dest [%d 0 R /XYZ 0 %.2F null]>>',$this->PageInfo[$l[0]]['n'],$h-$l[1]*$this->k);
}
$this->_newobj();
$this->_put($s);
$this->_put('endobj');
}
Expand Down
94 changes: 94 additions & 0 deletions tutorial/CevicheOne-Regular-Licence.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
Copyright (c) 2011 by LatinoType Limitada (luciano@latinotype.com),
with Reserved Font Names "Cecivhe" and "Ceviche One"

This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL


-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
25 changes: 25 additions & 0 deletions tutorial/CevicheOne-Regular.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php
$type = 'TrueType';
$name = 'CevicheOne-Regular';
$desc = array('Ascent'=>806,'Descent'=>-237,'CapHeight'=>425,'Flags'=>32,'FontBBox'=>'[-42 -237 1427 806]','ItalicAngle'=>0,'StemV'=>70,'MissingWidth'=>294);
$up = -75;
$ut = 50;
$cw = array(
chr(0)=>294,chr(1)=>294,chr(2)=>294,chr(3)=>294,chr(4)=>294,chr(5)=>294,chr(6)=>294,chr(7)=>294,chr(8)=>294,chr(9)=>294,chr(10)=>294,chr(11)=>294,chr(12)=>294,chr(13)=>294,chr(14)=>294,chr(15)=>294,chr(16)=>294,chr(17)=>294,chr(18)=>294,chr(19)=>294,chr(20)=>294,chr(21)=>294,
chr(22)=>294,chr(23)=>294,chr(24)=>294,chr(25)=>294,chr(26)=>294,chr(27)=>294,chr(28)=>294,chr(29)=>294,chr(30)=>294,chr(31)=>294,' '=>130,'!'=>254,'"'=>334,'#'=>496,'$'=>469,'%'=>765,'&'=>761,'\''=>148,'('=>268,')'=>269,'*'=>435,'+'=>442,
','=>235,'-'=>339,'.'=>233,'/'=>301,'0'=>512,'1'=>252,'2'=>501,'3'=>471,'4'=>537,'5'=>471,'6'=>501,'7'=>424,'8'=>506,'9'=>502,':'=>292,';'=>299,'<'=>463,'='=>483,'>'=>459,'?'=>453,'@'=>672,'A'=>511,
'B'=>573,'C'=>480,'D'=>541,'E'=>507,'F'=>490,'G'=>515,'H'=>517,'I'=>250,'J'=>270,'K'=>570,'L'=>368,'M'=>620,'N'=>548,'O'=>507,'P'=>540,'Q'=>532,'R'=>552,'S'=>490,'T'=>434,'U'=>527,'V'=>514,'W'=>670,
'X'=>541,'Y'=>497,'Z'=>499,'['=>288,'\\'=>472,']'=>288,'^'=>448,'_'=>350,'`'=>449,'a'=>446,'b'=>454,'c'=>394,'d'=>462,'e'=>404,'f'=>332,'g'=>458,'h'=>446,'i'=>234,'j'=>232,'k'=>457,'l'=>231,'m'=>659,
'n'=>450,'o'=>412,'p'=>436,'q'=>468,'r'=>389,'s'=>394,'t'=>318,'u'=>458,'v'=>421,'w'=>612,'x'=>450,'y'=>429,'z'=>423,'{'=>312,'|'=>231,'}'=>312,'~'=>504,chr(127)=>294,chr(128)=>586,chr(129)=>294,chr(130)=>176,chr(131)=>377,
chr(132)=>361,chr(133)=>761,chr(134)=>422,chr(135)=>425,chr(136)=>448,chr(137)=>1050,chr(138)=>490,chr(139)=>377,chr(140)=>787,chr(141)=>294,chr(142)=>499,chr(143)=>294,chr(144)=>294,chr(145)=>171,chr(146)=>148,chr(147)=>357,chr(148)=>334,chr(149)=>266,chr(150)=>444,chr(151)=>554,chr(152)=>416,chr(153)=>608,
chr(154)=>394,chr(155)=>378,chr(156)=>674,chr(157)=>294,chr(158)=>423,chr(159)=>497,chr(160)=>130,chr(161)=>253,chr(162)=>424,chr(163)=>510,chr(164)=>665,chr(165)=>551,chr(166)=>252,chr(167)=>413,chr(168)=>505,chr(169)=>675,chr(170)=>361,chr(171)=>668,chr(172)=>548,chr(173)=>440,chr(174)=>676,chr(175)=>413,
chr(176)=>278,chr(177)=>438,chr(178)=>328,chr(179)=>318,chr(180)=>449,chr(181)=>463,chr(182)=>535,chr(183)=>234,chr(184)=>535,chr(185)=>176,chr(186)=>322,chr(187)=>669,chr(188)=>761,chr(189)=>710,chr(190)=>904,chr(191)=>452,chr(192)=>511,chr(193)=>511,chr(194)=>514,chr(195)=>511,chr(196)=>511,chr(197)=>511,
chr(198)=>787,chr(199)=>480,chr(200)=>507,chr(201)=>507,chr(202)=>507,chr(203)=>507,chr(204)=>250,chr(205)=>250,chr(206)=>271,chr(207)=>272,chr(208)=>542,chr(209)=>548,chr(210)=>507,chr(211)=>507,chr(212)=>507,chr(213)=>507,chr(214)=>507,chr(215)=>496,chr(216)=>507,chr(217)=>527,chr(218)=>527,chr(219)=>526,
chr(220)=>527,chr(221)=>497,chr(222)=>522,chr(223)=>457,chr(224)=>446,chr(225)=>446,chr(226)=>446,chr(227)=>446,chr(228)=>446,chr(229)=>446,chr(230)=>635,chr(231)=>394,chr(232)=>404,chr(233)=>404,chr(234)=>412,chr(235)=>401,chr(236)=>235,chr(237)=>235,chr(238)=>256,chr(239)=>249,chr(240)=>475,chr(241)=>450,
chr(242)=>412,chr(243)=>412,chr(244)=>412,chr(245)=>413,chr(246)=>412,chr(247)=>444,chr(248)=>412,chr(249)=>458,chr(250)=>458,chr(251)=>458,chr(252)=>458,chr(253)=>429,chr(254)=>452,chr(255)=>429);
$enc = 'cp1252';
$uv = array(0=>array(0,128),128=>8364,130=>8218,131=>402,132=>8222,133=>8230,134=>array(8224,2),136=>710,137=>8240,138=>352,139=>8249,140=>338,142=>381,145=>array(8216,2),147=>array(8220,2),149=>8226,150=>array(8211,2),152=>732,153=>8482,154=>353,155=>8250,156=>339,158=>382,159=>376,160=>array(160,96));
$file = 'CevicheOne-Regular.z';
$originalsize = 25916;
$subsetted = true;
?>
Binary file added tutorial/CevicheOne-Regular.ttf
Binary file not shown.
Binary file added tutorial/CevicheOne-Regular.z
Binary file not shown.
25 changes: 0 additions & 25 deletions tutorial/calligra.php

This file was deleted.

Binary file removed tutorial/calligra.ttf
Binary file not shown.
Binary file removed tutorial/calligra.z
Binary file not shown.
21 changes: 8 additions & 13 deletions tutorial/tuto7.htm
Original file line number Diff line number Diff line change
Expand Up @@ -140,30 +140,25 @@ <h2>Declaration of the font in the script</h2>
</div>

<h2>Example</h2>
Let's now see a complete example. We will use the font <a href="http://www.abstractfonts.com/font/52" target="_blank">Calligrapher</a>.
Now let's see a complete example. We will use the <a href="https://fonts.google.com/specimen/Ceviche+One" target="_blank">Ceviche One</a> font.
The first step is the generation of the font files:
<div class="source">
<pre><code>&lt;?php
<span class="kw">require(</span><span class="str">'makefont/makefont.php'</span><span class="kw">);

</span>MakeFont<span class="kw">(</span><span class="str">'calligra.ttf'</span><span class="kw">,</span><span class="str">'cp1252'</span><span class="kw">);
</span>MakeFont<span class="kw">(</span><span class="str">'CevicheOne-Regular.ttf'</span><span class="kw">,</span><span class="str">'cp1252'</span><span class="kw">);
</span>?&gt;</code></pre>
</div>
The script gives the following report:
The script produces the following output:
<br>
<br>
<b>Warning:</b> character Euro is missing<br>
<b>Warning:</b> character zcaron is missing<br>
Font file compressed: calligra.z<br>
Font definition file generated: calligra.php<br>
<br>
The euro character is not present in the font (it's too old). Another character is missing too.
<br>
Font file compressed: CevicheOne-Regular.z<br>
Font definition file generated: CevicheOne-Regular.php<br>
<br>
Alternatively we could have used the command line:
<br>
<br>
<kbd>php makefont\makefont.php calligra.ttf cp1252</kbd>
<kbd>php makefont\makefont.php CevicheOne-Regular.ttf cp1252</kbd>
<br>
<br>
or used the online generator.
Expand All @@ -175,9 +170,9 @@ <h2>Example</h2>
<span class="kw">require(</span><span class="str">'fpdf.php'</span><span class="kw">);

</span>$pdf <span class="kw">= new </span>FPDF<span class="kw">();
</span>$pdf<span class="kw">-&gt;</span>AddFont<span class="kw">(</span><span class="str">'Calligrapher'</span><span class="kw">,</span><span class="str">''</span><span class="kw">,</span><span class="str">'calligra.php'</span><span class="kw">);
</span>$pdf<span class="kw">-&gt;</span>AddFont<span class="kw">(</span><span class="str">'CevicheOne'</span><span class="kw">,</span><span class="str">''</span><span class="kw">,</span><span class="str">'CevicheOne-Regular.php'</span><span class="kw">);
</span>$pdf<span class="kw">-&gt;</span>AddPage<span class="kw">();
</span>$pdf<span class="kw">-&gt;</span>SetFont<span class="kw">(</span><span class="str">'Calligrapher'</span><span class="kw">,</span><span class="str">''</span><span class="kw">,</span>35<span class="kw">);
</span>$pdf<span class="kw">-&gt;</span>SetFont<span class="kw">(</span><span class="str">'CevicheOne'</span><span class="kw">,</span><span class="str">''</span><span class="kw">,</span>35<span class="kw">);
</span>$pdf<span class="kw">-&gt;</span>Write<span class="kw">(</span>10<span class="kw">,</span><span class="str">'Enjoy new fonts with FPDF!'</span><span class="kw">);
</span>$pdf<span class="kw">-&gt;</span>Output<span class="kw">();
</span>?&gt;</code></pre>
Expand Down
4 changes: 2 additions & 2 deletions tutorial/tuto7.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
require('../fpdf.php');

$pdf = new FPDF();
$pdf->AddFont('Calligrapher','','calligra.php');
$pdf->AddFont('CevicheOne','','CevicheOne-Regular.php');
$pdf->AddPage();
$pdf->SetFont('Calligrapher','',35);
$pdf->SetFont('CevicheOne','',45);
$pdf->Cell(0,10,'Enjoy new fonts with FPDF!');
$pdf->Output();
?>

0 comments on commit b0ddd9c

Please sign in to comment.