first commit
This commit is contained in:
10
standort/prints/#alt/tutorial/20k_c1.txt
Normal file
10
standort/prints/#alt/tutorial/20k_c1.txt
Normal file
@ -0,0 +1,10 @@
|
||||
The year 1866 was marked by a bizarre development, an unexplained and downright inexplicable phenomenon that surely no one has forgotten. Without getting into those rumors that upset civilians in the seaports and deranged the public mind even far inland, it must be said that professional seamen were especially alarmed. Traders, shipowners, captains of vessels, skippers, and master mariners from Europe and America, naval officers from every country, and at their heels the various national governments on these two continents, were all extremely disturbed by the business.
|
||||
In essence, over a period of time several ships had encountered "an enormous thing" at sea, a long spindle-shaped object, sometimes giving off a phosphorescent glow, infinitely bigger and faster than any whale.
|
||||
The relevant data on this apparition, as recorded in various logbooks, agreed pretty closely as to the structure of the object or creature in question, its unprecedented speed of movement, its startling locomotive power, and the unique vitality with which it seemed to be gifted. If it was a cetacean, it exceeded in bulk any whale previously classified by science. No naturalist, neither Cuvier nor Lac<61>p<EFBFBD>de, neither Professor Dumeril nor Professor de Quatrefages, would have accepted the existence of such a monster sight unseen -- specifically, unseen by their own scientific eyes.
|
||||
Striking an average of observations taken at different times -- rejecting those timid estimates that gave the object a length of 200 feet, and ignoring those exaggerated views that saw it as a mile wide and three long--you could still assert that this phenomenal creature greatly exceeded the dimensions of anything then known to ichthyologists, if it existed at all.
|
||||
Now then, it did exist, this was an undeniable fact; and since the human mind dotes on objects of wonder, you can understand the worldwide excitement caused by this unearthly apparition. As for relegating it to the realm of fiction, that charge had to be dropped.
|
||||
In essence, on July 20, 1866, the steamer Governor Higginson, from the Calcutta & Burnach Steam Navigation Co., encountered this moving mass five miles off the eastern shores of Australia. Captain Baker at first thought he was in the presence of an unknown reef; he was even about to fix its exact position when two waterspouts shot out of this inexplicable object and sprang hissing into the air some 150 feet. So, unless this reef was subject to the intermittent eruptions of a geyser, the Governor Higginson had fair and honest dealings with some aquatic mammal, until then unknown, that could spurt from its blowholes waterspouts mixed with air and steam.
|
||||
Similar events were likewise observed in Pacific seas, on July 23 of the same year, by the Christopher Columbus from the West India & Pacific Steam Navigation Co. Consequently, this extraordinary cetacean could transfer itself from one locality to another with startling swiftness, since within an interval of just three days, the Governor Higginson and the Christopher Columbus had observed it at two positions on the charts separated by a distance of more than 700 nautical leagues.
|
||||
Fifteen days later and 2,000 leagues farther, the Helvetia from the Compagnie Nationale and the Shannon from the Royal Mail line, running on opposite tacks in that part of the Atlantic lying between the United States and Europe, respectively signaled each other that the monster had been sighted in latitude 42 degrees 15' north and longitude 60 degrees 35' west of the meridian of Greenwich. From their simultaneous observations, they were able to estimate the mammal's minimum length at more than 350 English feet; this was because both the Shannon and the Helvetia were of smaller dimensions, although each measured 100 meters stem to stern. Now then, the biggest whales, those rorqual whales that frequent the waterways of the Aleutian Islands, have never exceeded a length of 56 meters--if they reach even that.
|
||||
One after another, reports arrived that would profoundly affect public opinion: new observations taken by the transatlantic liner Pereire, the Inman line's Etna running afoul of the monster, an official report drawn up by officers on the French frigate Normandy, dead-earnest reckonings obtained by the general staff of Commodore Fitz-James aboard the Lord Clyde. In lighthearted countries, people joked about this phenomenon, but such serious, practical countries as England, America, and Germany were deeply concerned.
|
||||
In every big city the monster was the latest rage; they sang about it in the coffee houses, they ridiculed it in the newspapers, they dramatized it in the theaters. The tabloids found it a fine opportunity for hatching all sorts of hoaxes. In those newspapers short of copy, you saw the reappearance of every gigantic imaginary creature, from "Moby Dick," that dreadful white whale from the High Arctic regions, to the stupendous kraken whose tentacles could entwine a 500-ton craft and drag it into the ocean depths. They even reprinted reports from ancient times: the views of Aristotle and Pliny accepting the existence of such monsters, then the Norwegian stories of Bishop Pontoppidan, the narratives of Paul Egede, and finally the reports of Captain Harrington -- whose good faith is above suspicion--in which he claims he saw, while aboard the Castilian in 1857, one of those enormous serpents that, until then, had frequented only the seas of France's old extremist newspaper, The Constitutionalist.
|
23
standort/prints/#alt/tutorial/20k_c2.txt
Normal file
23
standort/prints/#alt/tutorial/20k_c2.txt
Normal file
@ -0,0 +1,23 @@
|
||||
During the period in which these developments were occurring, I had returned from a scientific undertaking organized to explore the Nebraska badlands in the United States. In my capacity as Assistant Professor at the Paris Museum of Natural History, I had been attached to this expedition by the French government. After spending six months in Nebraska, I arrived in New York laden with valuable collections near the end of March. My departure for France was set for early May. In the meantime, then, I was busy classifying my mineralogical, botanical, and zoological treasures when that incident took place with the Scotia.
|
||||
I was perfectly abreast of this question, which was the big news of the day, and how could I not have been? I had read and reread every American and European newspaper without being any farther along. This mystery puzzled me. Finding it impossible to form any views, I drifted from one extreme to the other. Something was out there, that much was certain, and any doubting Thomas was invited to place his finger on the Scotia's wound.
|
||||
When I arrived in New York, the question was at the boiling point. The hypothesis of a drifting islet or an elusive reef, put forward by people not quite in their right minds, was completely eliminated. And indeed, unless this reef had an engine in its belly, how could it move about with such prodigious speed?
|
||||
Also discredited was the idea of a floating hull or some other enormous wreckage, and again because of this speed of movement.
|
||||
So only two possible solutions to the question were left, creating two very distinct groups of supporters: on one side, those favoring a monster of colossal strength; on the other, those favoring an "underwater boat" of tremendous motor power.
|
||||
Now then, although the latter hypothesis was completely admissible, it couldn't stand up to inquiries conducted in both the New World and the Old. That a private individual had such a mechanism at his disposal was less than probable. Where and when had he built it, and how could he have built it in secret?
|
||||
Only some government could own such an engine of destruction, and in these disaster-filled times, when men tax their ingenuity to build increasingly powerful aggressive weapons, it was possible that, unknown to the rest of the world, some nation could have been testing such a fearsome machine. The Chassepot rifle led to the torpedo, and the torpedo has led to this underwater battering ram, which in turn will lead to the world putting its foot down. At least I hope it will.
|
||||
But this hypothesis of a war machine collapsed in the face of formal denials from the various governments. Since the public interest was at stake and transoceanic travel was suffering, the sincerity of these governments could not be doubted. Besides, how could the assembly of this underwater boat have escaped public notice? Keeping a secret under such circumstances would be difficult enough for an individual, and certainly impossible for a nation whose every move is under constant surveillance by rival powers.
|
||||
So, after inquiries conducted in England, France, Russia, Prussia, Spain, Italy, America, and even Turkey, the hypothesis of an underwater Monitor was ultimately rejected.
|
||||
After I arrived in New York, several people did me the honor of consulting me on the phenomenon in question. In France I had published a two-volume work, in quarto, entitled The Mysteries of the Great Ocean Depths. Well received in scholarly circles, this book had established me as a specialist in this pretty obscure field of natural history. My views were in demand. As long as I could deny the reality of the business, I confined myself to a flat "no comment." But soon, pinned to the wall, I had to explain myself straight out. And in this vein, "the honorable Pierre Aronnax, Professor at the Paris Museum," was summoned by The New York Herald to formulate his views no matter what.
|
||||
I complied. Since I could no longer hold my tongue, I let it wag. I discussed the question in its every aspect, both political and scientific, and this is an excerpt from the well-padded article I published in the issue of April 30.
|
||||
|
||||
"Therefore," I wrote, "after examining these different hypotheses one by one, we are forced, every other supposition having been refuted, to accept the existence of an extremely powerful marine animal.
|
||||
"The deepest parts of the ocean are totally unknown to us. No soundings have been able to reach them. What goes on in those distant depths? What creatures inhabit, or could inhabit, those regions twelve or fifteen miles beneath the surface of the water? What is the constitution of these animals? It's almost beyond conjecture.
|
||||
"However, the solution to this problem submitted to me can take the form of a choice between two alternatives.
|
||||
"Either we know every variety of creature populating our planet, or we do not.
|
||||
"If we do not know every one of them, if nature still keeps ichthyological secrets from us, nothing is more admissible than to accept the existence of fish or cetaceans of new species or even new genera, animals with a basically 'cast-iron' constitution that inhabit strata beyond the reach of our soundings, and which some development or other, an urge or a whim if you prefer, can bring to the upper level of the ocean for long intervals.
|
||||
"If, on the other hand, we do know every living species, we must look for the animal in question among those marine creatures already cataloged, and in this event I would be inclined to accept the existence of a giant narwhale.
|
||||
"The common narwhale, or sea unicorn, often reaches a length of sixty feet. Increase its dimensions fivefold or even tenfold, then give this cetacean a strength in proportion to its size while enlarging its offensive weapons, and you have the animal we're looking for. It would have the proportions determined by the officers of the Shannon, the instrument needed to perforate the Scotia, and the power to pierce a steamer's hull.
|
||||
"In essence, the narwhale is armed with a sort of ivory sword, or lance, as certain naturalists have expressed it. It's a king-sized tooth as hard as steel. Some of these teeth have been found buried in the bodies of baleen whales, which the narwhale attacks with invariable success. Others have been wrenched, not without difficulty, from the undersides of vessels that narwhales have pierced clean through, as a gimlet pierces a wine barrel. The museum at the Faculty of Medicine in Paris owns one of these tusks with a length of 2.25 meters and a width at its base of forty-eight centimeters!
|
||||
"All right then! Imagine this weapon to be ten times stronger and the animal ten times more powerful, launch it at a speed of twenty miles per hour, multiply its mass times its velocity, and you get just the collision we need to cause the specified catastrophe.
|
||||
"So, until information becomes more abundant, I plump for a sea unicorn of colossal dimensions, no longer armed with a mere lance but with an actual spur, like ironclad frigates or those warships called 'rams,' whose mass and motor power it would possess simultaneously.
|
||||
"This inexplicable phenomenon is thus explained away--unless it's something else entirely, which, despite everything that has been sighted, studied, explored and experienced, is still possible!"
|
275
standort/prints/#alt/tutorial/calligra.afm
Normal file
275
standort/prints/#alt/tutorial/calligra.afm
Normal file
@ -0,0 +1,275 @@
|
||||
StartFontMetrics 4.1
|
||||
FontName Calligrapher-Regular
|
||||
FullName Calligrapher Regular
|
||||
Notice Generated by Fontographer 3.5
|
||||
EncodingScheme FontSpecific
|
||||
FamilyName Calligrapher
|
||||
Weight Regular
|
||||
Version (Altsys Fontographer 3.5 5/26/92)
|
||||
Characters 215
|
||||
ItalicAngle 0.0
|
||||
Ascender 899
|
||||
Descender -234
|
||||
UnderlineThickness 20
|
||||
UnderlinePosition -200
|
||||
IsFixedPitch false
|
||||
FontBBox -50 -234 1328 899
|
||||
StartCharMetrics 256
|
||||
C 0 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 1 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 2 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 3 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 4 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 5 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 6 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 7 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 8 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 9 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 10 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 11 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 12 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 13 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 14 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 15 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 16 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 17 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 18 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 19 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 20 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 21 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 22 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 23 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 24 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 25 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 26 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 27 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 28 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 29 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 30 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 31 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 32 ; WX 282 ; N space ; B 67 -16 251 718 ;
|
||||
C 33 ; WX 324 ; N exclam ; B 67 -16 251 718 ;
|
||||
C 34 ; WX 405 ; N quotedbl ; B 60 460 353 718 ;
|
||||
C 35 ; WX 584 ; N numbersign ; B 35 0 549 701 ;
|
||||
C 36 ; WX 632 ; N dollar ; B 32 -126 595 814 ;
|
||||
C 37 ; WX 980 ; N percent ; B 35 -16 945 703 ;
|
||||
C 38 ; WX 776 ; N ampersand ; B 41 -17 811 670 ;
|
||||
C 39 ; WX 259 ; N quotesingle ; B 72 460 206 718 ;
|
||||
C 40 ; WX 299 ; N parenleft ; B 57 -119 299 785 ;
|
||||
C 41 ; WX 299 ; N parenright ; B 0 -119 242 785 ;
|
||||
C 42 ; WX 377 ; N asterisk ; B 35 407 342 714 ;
|
||||
C 43 ; WX 600 ; N plus ; B 47 0 553 506 ;
|
||||
C 44 ; WX 259 ; N comma ; B 35 -67 224 162 ;
|
||||
C 45 ; WX 432 ; N hyphen ; B 28 249 404 377 ;
|
||||
C 46 ; WX 254 ; N period ; B 43 -16 227 162 ;
|
||||
C 47 ; WX 597 ; N slash ; B 7 -14 591 714 ;
|
||||
C 48 ; WX 529 ; N zero ; B 21 -18 508 583 ;
|
||||
C 49 ; WX 298 ; N one ; B 8 -15 233 582 ;
|
||||
C 50 ; WX 451 ; N two ; B 17 -8 430 588 ;
|
||||
C 51 ; WX 359 ; N three ; B 11 -54 337 582 ;
|
||||
C 52 ; WX 525 ; N four ; B 18 -20 519 602 ;
|
||||
C 53 ; WX 423 ; N five ; B 10 -55 420 582 ;
|
||||
C 54 ; WX 464 ; N six ; B 23 -14 447 589 ;
|
||||
C 55 ; WX 417 ; N seven ; B 8 -18 415 589 ;
|
||||
C 56 ; WX 457 ; N eight ; B 19 -16 432 583 ;
|
||||
C 57 ; WX 479 ; N nine ; B 26 -16 450 588 ;
|
||||
C 58 ; WX 275 ; N colon ; B 59 -16 242 491 ;
|
||||
C 59 ; WX 282 ; N semicolon ; B 54 -67 245 491 ;
|
||||
C 60 ; WX 600 ; N less ; B 47 -8 553 514 ;
|
||||
C 61 ; WX 600 ; N equal ; B 47 98 553 408 ;
|
||||
C 62 ; WX 600 ; N greater ; B 47 -8 553 514 ;
|
||||
C 63 ; WX 501 ; N question ; B 21 -16 473 721 ;
|
||||
C 64 ; WX 800 ; N at ; B 29 -12 771 730 ;
|
||||
C 65 ; WX 743 ; N A ; B -23 -14 754 723 ;
|
||||
C 66 ; WX 636 ; N B ; B -42 -7 608 706 ;
|
||||
C 67 ; WX 598 ; N C ; B 27 -12 572 712 ;
|
||||
C 68 ; WX 712 ; N D ; B -42 -11 684 705 ;
|
||||
C 69 ; WX 608 ; N E ; B -21 0 608 708 ;
|
||||
C 70 ; WX 562 ; N F ; B -21 -18 584 716 ;
|
||||
C 71 ; WX 680 ; N G ; B 29 -8 668 714 ;
|
||||
C 72 ; WX 756 ; N H ; B 70 -17 777 728 ;
|
||||
C 73 ; WX 308 ; N I ; B 14 -15 238 718 ;
|
||||
C 74 ; WX 314 ; N J ; B 7 -223 244 727 ;
|
||||
C 75 ; WX 676 ; N K ; B 14 -16 683 725 ;
|
||||
C 76 ; WX 552 ; N L ; B 14 -8 580 713 ;
|
||||
C 77 ; WX 1041 ; N M ; B 42 -17 1017 739 ;
|
||||
C 78 ; WX 817 ; N N ; B -42 -17 747 736 ;
|
||||
C 79 ; WX 729 ; N O ; B 32 -16 698 709 ;
|
||||
C 80 ; WX 569 ; N P ; B -35 -15 570 716 ;
|
||||
C 81 ; WX 698 ; N Q ; B 27 -201 1328 715 ;
|
||||
C 82 ; WX 674 ; N R ; B -35 -20 696 712 ;
|
||||
C 83 ; WX 618 ; N S ; B 31 -16 589 709 ;
|
||||
C 84 ; WX 673 ; N T ; B -21 -20 702 714 ;
|
||||
C 85 ; WX 805 ; N U ; B 0 -19 804 722 ;
|
||||
C 86 ; WX 753 ; N V ; B -28 -20 788 729 ;
|
||||
C 87 ; WX 1238 ; N W ; B -28 -17 1273 736 ;
|
||||
C 88 ; WX 716 ; N X ; B 7 -38 709 731 ;
|
||||
C 89 ; WX 754 ; N Y ; B -35 -17 789 747 ;
|
||||
C 90 ; WX 599 ; N Z ; B 30 -5 584 748 ;
|
||||
C 91 ; WX 315 ; N bracketleft ; B 93 -124 322 718 ;
|
||||
C 92 ; WX 463 ; N backslash ; B -21 -18 484 736 ;
|
||||
C 93 ; WX 315 ; N bracketright ; B -7 -124 222 718 ;
|
||||
C 94 ; WX 600 ; N asciicircum ; B 63 266 537 658 ;
|
||||
C 95 ; WX 547 ; N underscore ; B -7 -198 554 -163 ;
|
||||
C 96 ; WX 278 ; N grave ; B -1 541 214 693 ;
|
||||
C 97 ; WX 581 ; N a ; B 21 -16 581 494 ;
|
||||
C 98 ; WX 564 ; N b ; B -24 -17 543 793 ;
|
||||
C 99 ; WX 440 ; N c ; B 21 -17 422 490 ;
|
||||
C 100 ; WX 571 ; N d ; B 0 -15 550 659 ;
|
||||
C 101 ; WX 450 ; N e ; B 28 -23 428 493 ;
|
||||
C 102 ; WX 347 ; N f ; B -35 -14 474 785 ;
|
||||
C 103 ; WX 628 ; N g ; B 19 -219 612 496 ;
|
||||
C 104 ; WX 611 ; N h ; B -29 -18 569 785 ;
|
||||
C 105 ; WX 283 ; N i ; B -14 -15 241 679 ;
|
||||
C 106 ; WX 283 ; N j ; B -14 -234 241 679 ;
|
||||
C 107 ; WX 560 ; N k ; B -24 -15 582 789 ;
|
||||
C 108 ; WX 252 ; N l ; B -28 -15 210 789 ;
|
||||
C 109 ; WX 976 ; N m ; B -21 -16 927 494 ;
|
||||
C 110 ; WX 595 ; N n ; B -28 -15 574 493 ;
|
||||
C 111 ; WX 508 ; N o ; B 27 -17 485 490 ;
|
||||
C 112 ; WX 549 ; N p ; B -28 -216 526 496 ;
|
||||
C 113 ; WX 540 ; N q ; B 28 -219 491 493 ;
|
||||
C 114 ; WX 395 ; N r ; B -21 -19 430 492 ;
|
||||
C 115 ; WX 441 ; N s ; B 34 -15 413 493 ;
|
||||
C 116 ; WX 307 ; N t ; B -21 -16 378 621 ;
|
||||
C 117 ; WX 614 ; N u ; B -14 -18 558 501 ;
|
||||
C 118 ; WX 556 ; N v ; B -28 -20 569 483 ;
|
||||
C 119 ; WX 915 ; N w ; B -28 -17 928 495 ;
|
||||
C 120 ; WX 559 ; N x ; B 14 -17 546 500 ;
|
||||
C 121 ; WX 597 ; N y ; B -21 -227 541 500 ;
|
||||
C 122 ; WX 452 ; N z ; B 28 -5 442 515 ;
|
||||
C 123 ; WX 315 ; N braceleft ; B 6 -118 309 718 ;
|
||||
C 124 ; WX 222 ; N bar ; B 63 -18 159 730 ;
|
||||
C 125 ; WX 315 ; N braceright ; B 6 -118 309 718 ;
|
||||
C 126 ; WX 600 ; N asciitilde ; B 69 166 531 340 ;
|
||||
C 127 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 128 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 129 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 130 ; WX 0 ; N quotesinglbase ; B -23 -14 754 877 ;
|
||||
C 131 ; WX 0 ; N florin ; B 0 -19 804 854 ;
|
||||
C 132 ; WX 0 ; N quotedblbase ; B -23 -14 754 877 ;
|
||||
C 133 ; WX 780 ; N ellipsis ; B 43 -16 747 162 ;
|
||||
C 134 ; WX 0 ; N dagger ; B 27 -122 437 592 ;
|
||||
C 135 ; WX 0 ; N daggerdbl ; B 43 278 227 456 ;
|
||||
C 136 ; WX 278 ; N circumflex ; B -14 557 292 677 ;
|
||||
C 137 ; WX 0 ; N perthousand ; B -23 -14 754 877 ;
|
||||
C 138 ; WX 0 ; N Scaron ; B 0 0 0 100 ;
|
||||
C 139 ; WX 0 ; N guilsinglleft ; B 43 278 227 456 ;
|
||||
C 140 ; WX 1064 ; N OE ; B 32 -16 1055 709 ;
|
||||
C 141 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 142 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 143 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 144 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 145 ; WX 259 ; N quoteleft ; B 35 489 224 717 ;
|
||||
C 146 ; WX 259 ; N quoteright ; B 35 489 224 717 ;
|
||||
C 147 ; WX 470 ; N quotedblleft ; B 35 489 443 717 ;
|
||||
C 148 ; WX 470 ; N quotedblright ; B 35 487 443 717 ;
|
||||
C 149 ; WX 500 ; N bullet ; B 70 179 430 539 ;
|
||||
C 150 ; WX 300 ; N endash ; B 0 245 300 350 ;
|
||||
C 151 ; WX 600 ; N emdash ; B 0 245 600 350 ;
|
||||
C 152 ; WX 278 ; N tilde ; B -44 563 326 689 ;
|
||||
C 153 ; WX 990 ; N trademark ; B 62 306 928 718 ;
|
||||
C 154 ; WX 0 ; N scaron ; B 0 0 0 100 ;
|
||||
C 155 ; WX 0 ; N guilsinglright ; B 43 278 227 456 ;
|
||||
C 156 ; WX 790 ; N oe ; B 27 -23 764 493 ;
|
||||
C 157 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 158 ; WX 800 ; N .notdef ; B 50 0 750 800 ;
|
||||
C 159 ; WX 754 ; N Ydieresis ; B -35 -17 789 882 ;
|
||||
C 160 ; WX 282 ; N nbspace ; B -23 -14 754 893 ;
|
||||
C 161 ; WX 324 ; N exclamdown ; B 69 -203 253 531 ;
|
||||
C 162 ; WX 450 ; N cent ; B 27 -122 437 592 ;
|
||||
C 163 ; WX 640 ; N sterling ; B 0 -9 619 716 ;
|
||||
C 164 ; WX 518 ; N currency ; B 3 72 515 586 ;
|
||||
C 165 ; WX 603 ; N yen ; B -28 -65 631 747 ;
|
||||
C 166 ; WX 0 ; N brokenbar ; B 0 0 0 100 ;
|
||||
C 167 ; WX 519 ; N section ; B -50 -216 524 762 ;
|
||||
C 168 ; WX 254 ; N dieresis ; B -20 554 308 682 ;
|
||||
C 169 ; WX 800 ; N copyright ; B 29 -12 771 730 ;
|
||||
C 170 ; WX 349 ; N ordfeminine ; B 13 385 349 717 ;
|
||||
C 171 ; WX 0 ; N guillemotleft ; B 43 -16 747 162 ;
|
||||
C 172 ; WX 0 ; N logicalnot ; B 30 0 730 700 ;
|
||||
C 173 ; WX 432 ; N hyphen ; B 28 249 404 377 ;
|
||||
C 174 ; WX 800 ; N registered ; B 29 -12 771 730 ;
|
||||
C 175 ; WX 278 ; N macron ; B -47 584 325 665 ;
|
||||
C 176 ; WX 0 ; N degree ; B 27 -122 437 592 ;
|
||||
C 177 ; WX 0 ; N plusminus ; B 29 -8 668 877 ;
|
||||
C 178 ; WX 0 ; N twosuperior ; B 0 0 0 100 ;
|
||||
C 179 ; WX 0 ; N threesuperior ; B 0 0 0 100 ;
|
||||
C 180 ; WX 278 ; N acute ; B 49 536 279 693 ;
|
||||
C 181 ; WX 614 ; N mu ; B -14 -231 558 501 ;
|
||||
C 182 ; WX 0 ; N paragraph ; B -35 -15 668 785 ;
|
||||
C 183 ; WX 254 ; N periodcentered ; B 43 278 227 456 ;
|
||||
C 184 ; WX 278 ; N cedilla ; B -8 -216 231 6 ;
|
||||
C 185 ; WX 0 ; N onesuperior ; B 0 0 0 100 ;
|
||||
C 186 ; WX 305 ; N ordmasculine ; B 16 373 291 702 ;
|
||||
C 187 ; WX 0 ; N guillemotright ; B 43 -16 747 162 ;
|
||||
C 188 ; WX 0 ; N onequarter ; B 0 0 0 100 ;
|
||||
C 189 ; WX 0 ; N onehalf ; B 0 0 0 100 ;
|
||||
C 190 ; WX 0 ; N threequarters ; B 0 0 0 100 ;
|
||||
C 191 ; WX 501 ; N questiondown ; B 15 -196 467 541 ;
|
||||
C 192 ; WX 743 ; N Agrave ; B -23 -14 754 893 ;
|
||||
C 193 ; WX 743 ; N Aacute ; B -23 -14 754 893 ;
|
||||
C 194 ; WX 743 ; N Acircumflex ; B -23 -14 754 877 ;
|
||||
C 195 ; WX 743 ; N Atilde ; B -23 -14 754 889 ;
|
||||
C 196 ; WX 743 ; N Adieresis ; B -23 -14 754 882 ;
|
||||
C 197 ; WX 743 ; N Aring ; B -23 -14 754 899 ;
|
||||
C 198 ; WX 1060 ; N AE ; B -29 -14 1053 708 ;
|
||||
C 199 ; WX 598 ; N Ccedilla ; B 27 -183 572 712 ;
|
||||
C 200 ; WX 608 ; N Egrave ; B -21 0 608 893 ;
|
||||
C 201 ; WX 608 ; N Eacute ; B -21 0 608 893 ;
|
||||
C 202 ; WX 608 ; N Ecircumflex ; B -21 0 608 877 ;
|
||||
C 203 ; WX 608 ; N Edieresis ; B -21 0 608 882 ;
|
||||
C 204 ; WX 308 ; N Igrave ; B 14 -15 264 893 ;
|
||||
C 205 ; WX 308 ; N Iacute ; B 14 -15 274 893 ;
|
||||
C 206 ; WX 308 ; N Icircumflex ; B 1 -15 307 877 ;
|
||||
C 207 ; WX 308 ; N Idieresis ; B -15 -15 313 882 ;
|
||||
C 208 ; WX 0 ; N Eth ; B 0 0 0 100 ;
|
||||
C 209 ; WX 817 ; N Ntilde ; B -42 -17 747 889 ;
|
||||
C 210 ; WX 729 ; N Ograve ; B 32 -16 698 893 ;
|
||||
C 211 ; WX 729 ; N Oacute ; B 32 -16 698 893 ;
|
||||
C 212 ; WX 729 ; N Ocircumflex ; B 32 -16 698 877 ;
|
||||
C 213 ; WX 729 ; N Otilde ; B 32 -16 698 889 ;
|
||||
C 214 ; WX 729 ; N Odieresis ; B 32 -16 698 882 ;
|
||||
C 215 ; WX 0 ; N multiply ; B 0 0 0 100 ;
|
||||
C 216 ; WX 729 ; N Oslash ; B 14 -24 724 709 ;
|
||||
C 217 ; WX 805 ; N Ugrave ; B 0 -19 804 893 ;
|
||||
C 218 ; WX 805 ; N Uacute ; B 0 -19 804 893 ;
|
||||
C 219 ; WX 805 ; N Ucircumflex ; B 0 -19 804 877 ;
|
||||
C 220 ; WX 805 ; N Udieresis ; B 0 -19 804 882 ;
|
||||
C 221 ; WX 0 ; N _235 ; B 0 0 0 100 ;
|
||||
C 222 ; WX 0 ; N Thorn ; B 0 0 0 100 ;
|
||||
C 223 ; WX 688 ; N germandbls ; B -35 -15 668 785 ;
|
||||
C 224 ; WX 581 ; N agrave ; B 21 -16 581 693 ;
|
||||
C 225 ; WX 581 ; N aacute ; B 21 -16 581 693 ;
|
||||
C 226 ; WX 581 ; N acircumflex ; B 21 -16 581 677 ;
|
||||
C 227 ; WX 581 ; N atilde ; B 21 -16 581 689 ;
|
||||
C 228 ; WX 581 ; N adieresis ; B 21 -16 581 682 ;
|
||||
C 229 ; WX 581 ; N aring ; B 21 -16 581 734 ;
|
||||
C 230 ; WX 792 ; N ae ; B 21 -23 773 494 ;
|
||||
C 231 ; WX 440 ; N ccedilla ; B 21 -183 422 490 ;
|
||||
C 232 ; WX 450 ; N egrave ; B 28 -23 428 693 ;
|
||||
C 233 ; WX 450 ; N eacute ; B 28 -23 428 693 ;
|
||||
C 234 ; WX 450 ; N ecircumflex ; B 28 -23 432 677 ;
|
||||
C 235 ; WX 450 ; N edieresis ; B 28 -23 428 682 ;
|
||||
C 236 ; WX 283 ; N igrave ; B -14 -15 244 693 ;
|
||||
C 237 ; WX 283 ; N iacute ; B -14 -15 269 693 ;
|
||||
C 238 ; WX 283 ; N icircumflex ; B -14 -15 297 677 ;
|
||||
C 239 ; WX 283 ; N idieresis ; B -25 -15 303 682 ;
|
||||
C 240 ; WX 0 ; N Yacute ; B 0 0 0 100 ;
|
||||
C 241 ; WX 595 ; N ntilde ; B -28 -15 574 689 ;
|
||||
C 242 ; WX 508 ; N ograve ; B 27 -17 485 693 ;
|
||||
C 243 ; WX 508 ; N oacute ; B 27 -17 485 693 ;
|
||||
C 244 ; WX 508 ; N ocircumflex ; B 27 -17 485 677 ;
|
||||
C 245 ; WX 508 ; N otilde ; B 27 -17 485 689 ;
|
||||
C 246 ; WX 508 ; N odieresis ; B 27 -17 485 682 ;
|
||||
C 247 ; WX 0 ; N divide ; B 35 0 760 727 ;
|
||||
C 248 ; WX 508 ; N oslash ; B -8 -54 496 589 ;
|
||||
C 249 ; WX 614 ; N ugrave ; B -14 -18 558 693 ;
|
||||
C 250 ; WX 614 ; N uacute ; B -14 -18 558 693 ;
|
||||
C 251 ; WX 614 ; N ucircumflex ; B -14 -18 558 677 ;
|
||||
C 252 ; WX 614 ; N udieresis ; B -14 -18 558 682 ;
|
||||
C 253 ; WX 0 ; N yacute ; B 0 0 0 100 ;
|
||||
C 254 ; WX 0 ; N thorn ; B 0 0 0 100 ;
|
||||
C 255 ; WX 597 ; N ydieresis ; B -21 -227 541 682 ;
|
||||
EndCharMetrics
|
||||
EndFontMetrics
|
24
standort/prints/#alt/tutorial/calligra.php
Normal file
24
standort/prints/#alt/tutorial/calligra.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
$type='TrueType';
|
||||
$name='Calligrapher-Regular';
|
||||
$desc=array('Ascent'=>899,'Descent'=>-234,'CapHeight'=>731,'Flags'=>32,'FontBBox'=>'[-50 -234 1328 899]','ItalicAngle'=>0,'StemV'=>70,'MissingWidth'=>800);
|
||||
$up=-200;
|
||||
$ut=20;
|
||||
$cw=array(
|
||||
chr(0)=>800,chr(1)=>800,chr(2)=>800,chr(3)=>800,chr(4)=>800,chr(5)=>800,chr(6)=>800,chr(7)=>800,chr(8)=>800,chr(9)=>800,chr(10)=>800,chr(11)=>800,chr(12)=>800,chr(13)=>800,chr(14)=>800,chr(15)=>800,chr(16)=>800,chr(17)=>800,chr(18)=>800,chr(19)=>800,chr(20)=>800,chr(21)=>800,
|
||||
chr(22)=>800,chr(23)=>800,chr(24)=>800,chr(25)=>800,chr(26)=>800,chr(27)=>800,chr(28)=>800,chr(29)=>800,chr(30)=>800,chr(31)=>800,' '=>282,'!'=>324,'"'=>405,'#'=>584,'$'=>632,'%'=>980,'&'=>776,'\''=>259,'('=>299,')'=>299,'*'=>377,'+'=>600,
|
||||
','=>259,'-'=>432,'.'=>254,'/'=>597,'0'=>529,'1'=>298,'2'=>451,'3'=>359,'4'=>525,'5'=>423,'6'=>464,'7'=>417,'8'=>457,'9'=>479,':'=>275,';'=>282,'<'=>600,'='=>600,'>'=>600,'?'=>501,'@'=>800,'A'=>743,
|
||||
'B'=>636,'C'=>598,'D'=>712,'E'=>608,'F'=>562,'G'=>680,'H'=>756,'I'=>308,'J'=>314,'K'=>676,'L'=>552,'M'=>1041,'N'=>817,'O'=>729,'P'=>569,'Q'=>698,'R'=>674,'S'=>618,'T'=>673,'U'=>805,'V'=>753,'W'=>1238,
|
||||
'X'=>716,'Y'=>754,'Z'=>599,'['=>315,'\\'=>463,']'=>315,'^'=>600,'_'=>547,'`'=>278,'a'=>581,'b'=>564,'c'=>440,'d'=>571,'e'=>450,'f'=>347,'g'=>628,'h'=>611,'i'=>283,'j'=>283,'k'=>560,'l'=>252,'m'=>976,
|
||||
'n'=>595,'o'=>508,'p'=>549,'q'=>540,'r'=>395,'s'=>441,'t'=>307,'u'=>614,'v'=>556,'w'=>915,'x'=>559,'y'=>597,'z'=>452,'{'=>315,'|'=>222,'}'=>315,'~'=>600,chr(127)=>800,chr(128)=>800,chr(129)=>800,chr(130)=>0,chr(131)=>0,
|
||||
chr(132)=>0,chr(133)=>780,chr(134)=>0,chr(135)=>0,chr(136)=>278,chr(137)=>0,chr(138)=>0,chr(139)=>0,chr(140)=>1064,chr(141)=>800,chr(142)=>800,chr(143)=>800,chr(144)=>800,chr(145)=>259,chr(146)=>259,chr(147)=>470,chr(148)=>470,chr(149)=>500,chr(150)=>300,chr(151)=>600,chr(152)=>278,chr(153)=>990,
|
||||
chr(154)=>0,chr(155)=>0,chr(156)=>790,chr(157)=>800,chr(158)=>800,chr(159)=>754,chr(160)=>282,chr(161)=>324,chr(162)=>450,chr(163)=>640,chr(164)=>518,chr(165)=>603,chr(166)=>0,chr(167)=>519,chr(168)=>254,chr(169)=>800,chr(170)=>349,chr(171)=>0,chr(172)=>0,chr(173)=>432,chr(174)=>800,chr(175)=>278,
|
||||
chr(176)=>0,chr(177)=>0,chr(178)=>0,chr(179)=>0,chr(180)=>278,chr(181)=>614,chr(182)=>0,chr(183)=>254,chr(184)=>278,chr(185)=>0,chr(186)=>305,chr(187)=>0,chr(188)=>0,chr(189)=>0,chr(190)=>0,chr(191)=>501,chr(192)=>743,chr(193)=>743,chr(194)=>743,chr(195)=>743,chr(196)=>743,chr(197)=>743,
|
||||
chr(198)=>1060,chr(199)=>598,chr(200)=>608,chr(201)=>608,chr(202)=>608,chr(203)=>608,chr(204)=>308,chr(205)=>308,chr(206)=>308,chr(207)=>308,chr(208)=>0,chr(209)=>817,chr(210)=>729,chr(211)=>729,chr(212)=>729,chr(213)=>729,chr(214)=>729,chr(215)=>0,chr(216)=>729,chr(217)=>805,chr(218)=>805,chr(219)=>805,
|
||||
chr(220)=>805,chr(221)=>0,chr(222)=>0,chr(223)=>688,chr(224)=>581,chr(225)=>581,chr(226)=>581,chr(227)=>581,chr(228)=>581,chr(229)=>581,chr(230)=>792,chr(231)=>440,chr(232)=>450,chr(233)=>450,chr(234)=>450,chr(235)=>450,chr(236)=>283,chr(237)=>283,chr(238)=>283,chr(239)=>283,chr(240)=>800,chr(241)=>595,
|
||||
chr(242)=>508,chr(243)=>508,chr(244)=>508,chr(245)=>508,chr(246)=>508,chr(247)=>0,chr(248)=>508,chr(249)=>614,chr(250)=>614,chr(251)=>614,chr(252)=>614,chr(253)=>0,chr(254)=>0,chr(255)=>597);
|
||||
$enc='cp1252';
|
||||
$diff='';
|
||||
$file='calligra.z';
|
||||
$originalsize=40120;
|
||||
?>
|
BIN
standort/prints/#alt/tutorial/calligra.ttf
Normal file
BIN
standort/prints/#alt/tutorial/calligra.ttf
Normal file
Binary file not shown.
BIN
standort/prints/#alt/tutorial/calligra.z
Normal file
BIN
standort/prints/#alt/tutorial/calligra.z
Normal file
Binary file not shown.
15
standort/prints/#alt/tutorial/countries.txt
Normal file
15
standort/prints/#alt/tutorial/countries.txt
Normal file
@ -0,0 +1,15 @@
|
||||
Austria;Vienna;83859;8075
|
||||
Belgium;Brussels;30518;10192
|
||||
Denmark;Copenhagen;43094;5295
|
||||
Finland;Helsinki;304529;5147
|
||||
France;Paris;543965;58728
|
||||
Germany;Berlin;357022;82057
|
||||
Greece;Athens;131625;10511
|
||||
Ireland;Dublin;70723;3694
|
||||
Italy;Roma;301316;57563
|
||||
Luxembourg;Luxembourg;2586;424
|
||||
Netherlands;Amsterdam;41526;15654
|
||||
Portugal;Lisbon;91906;9957
|
||||
Spain;Madrid;504790;39348
|
||||
Sweden;Stockholm;410934;8839
|
||||
United Kingdom;London;243820;58862
|
18
standort/prints/#alt/tutorial/index.htm
Normal file
18
standort/prints/#alt/tutorial/index.htm
Normal file
@ -0,0 +1,18 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
|
||||
<TITLE>Tutorials</TITLE>
|
||||
<LINK TYPE="text/css" REL="stylesheet" HREF="../fpdf.css">
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H2>Tutorials</H2>
|
||||
The different examples rapidly show how to use FPDF. You will find all main features explained.<BR><BR>
|
||||
<A HREF="tuto1.htm">Tutorial 1</A>: Minimal example<BR>
|
||||
<A HREF="tuto2.htm">Tutorial 2</A>: Header, footer, page break and image<BR>
|
||||
<A HREF="tuto3.htm">Tutorial 3</A>: Line breaks and colors<BR>
|
||||
<A HREF="tuto4.htm">Tutorial 4</A>: Multi-columns<BR>
|
||||
<A HREF="tuto5.htm">Tutorial 5</A>: Tables<BR>
|
||||
<A HREF="tuto6.htm">Tutorial 6</A>: Links and flowing text<BR>
|
||||
<A HREF="tuto7.htm">Tutorial 7</A>: Adding new fonts and encoding support<BR>
|
||||
</BODY>
|
||||
</HTML>
|
BIN
standort/prints/#alt/tutorial/logo.png
Normal file
BIN
standort/prints/#alt/tutorial/logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.3 KiB |
BIN
standort/prints/#alt/tutorial/logo_pb.png
Normal file
BIN
standort/prints/#alt/tutorial/logo_pb.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.6 KiB |
6
standort/prints/#alt/tutorial/makefont.php
Normal file
6
standort/prints/#alt/tutorial/makefont.php
Normal file
@ -0,0 +1,6 @@
|
||||
<?php
|
||||
//Generation of font definition file for tutorial 7
|
||||
require('../font/makefont/makefont.php');
|
||||
|
||||
MakeFont('calligra.ttf','calligra.afm');
|
||||
?>
|
91
standort/prints/#alt/tutorial/tuto1.htm
Normal file
91
standort/prints/#alt/tutorial/tuto1.htm
Normal file
@ -0,0 +1,91 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
|
||||
<TITLE>Minimal example</TITLE>
|
||||
<LINK TYPE="text/css" REL="stylesheet" HREF="../fpdf.css">
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H2>Minimal example</H2>
|
||||
Let's start with the classic example:
|
||||
<BR>
|
||||
<BR>
|
||||
<TABLE WIDTH="100%" STYLE="color:#4040C0; border-style:ridge" BORDERCOLORLIGHT="#B0B0E0" BORDERCOLORDARK="#000000" BORDER="2" CELLPADDING=6 CELLSPACING=0 BGCOLOR="#F0F5FF"><TR><TD style="border-width:0px">
|
||||
<NOBR><code><font color="#000000">
|
||||
<?php<br><font class="kw">require(</font><font class="str">'fpdf.php'</font><font class="kw">);<br><br></font>$pdf<font class="kw">=new </font>FPDF<font class="kw">();<br></font>$pdf<font class="kw">-></font>AddPage<font class="kw">();<br></font>$pdf<font class="kw">-></font>SetFont<font class="kw">(</font><font class="str">'Arial'</font><font class="kw">,</font><font class="str">'B'</font><font class="kw">,</font>16<font class="kw">);<br></font>$pdf<font class="kw">-></font>Cell<font class="kw">(</font>40<font class="kw">,</font>10<font class="kw">,</font><font class="str">'Hello World!'</font><font class="kw">);<br></font>$pdf<font class="kw">-></font>Output<font class="kw">();<br></font>?>
|
||||
</font>
|
||||
</code></NOBR></TD></TR></TABLE><P></P>
|
||||
<SCRIPT>
|
||||
<!--
|
||||
if(document.location.href.indexOf('http:')==0)
|
||||
{
|
||||
document.write("<P CLASS='demo'><A HREF='tuto1.php' TARGET='_blank' CLASS='demo'>[Demo]</A></P>");
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
After including the library file, we create an FPDF object.
|
||||
The <A HREF='../doc/fpdf.htm'>FPDF()</A> constructor is used here with the default values: pages are in A4 portrait and
|
||||
the measure unit is millimeter. It could have been specified explicitly with:
|
||||
<BR>
|
||||
<BR>
|
||||
<TABLE WIDTH="100%" STYLE="color:#4040C0; border-style:ridge" BORDERCOLORLIGHT="#B0B0E0" BORDERCOLORDARK="#000000" BORDER="2" CELLPADDING=6 CELLSPACING=0 BGCOLOR="#F0F5FF"><TR><TD style="border-width:0px">
|
||||
<NOBR><code><font color="#000000">
|
||||
$pdf<font class="kw">=new </font>FPDF<font class="kw">(</font><font class="str">'P'</font><font class="kw">,</font><font class="str">'mm'</font><font class="kw">,</font><font class="str">'A4'</font><font class="kw">);</font><br>
|
||||
</font>
|
||||
</code></NOBR></TD></TR></TABLE><P></P>
|
||||
It is possible to use landscape (<TT>L</TT>), other page formats (such as <TT>Letter</TT> and
|
||||
<TT>Legal</TT>) and measure units (<TT>pt</TT>, <TT>cm</TT>, <TT>in</TT>).
|
||||
<BR>
|
||||
<BR>
|
||||
There is no page for the moment, so we have to add one with <A HREF='../doc/addpage.htm'>AddPage()</A>. The origin
|
||||
is at the upper-left corner and the current position is by default placed at 1 cm from the
|
||||
borders; the margins can be changed with <A HREF='../doc/setmargins.htm'>SetMargins()</A>.
|
||||
<BR>
|
||||
<BR>
|
||||
Before we can print text, it is mandatory to select a font with <A HREF='../doc/setfont.htm'>SetFont()</A>, otherwise the
|
||||
document would be invalid. We choose Arial bold 16:
|
||||
<BR>
|
||||
<BR>
|
||||
<TABLE WIDTH="100%" STYLE="color:#4040C0; border-style:ridge" BORDERCOLORLIGHT="#B0B0E0" BORDERCOLORDARK="#000000" BORDER="2" CELLPADDING=6 CELLSPACING=0 BGCOLOR="#F0F5FF"><TR><TD style="border-width:0px">
|
||||
<NOBR><code><font color="#000000">
|
||||
$pdf<font class="kw">-></font>SetFont<font class="kw">(</font><font class="str">'Arial'</font><font class="kw">,</font><font class="str">'B'</font><font class="kw">,</font>16<font class="kw">);</font><br>
|
||||
</font>
|
||||
</code></NOBR></TD></TR></TABLE><P></P>
|
||||
We could have specified italics with I, underlined with U or a regular font with an empty string
|
||||
(or any combination). Note that the font size is given in points, not millimeters (or another
|
||||
user unit); it is the only exception. The other standard fonts are Times, Courier, Symbol and
|
||||
ZapfDingbats.
|
||||
<BR>
|
||||
<BR>
|
||||
We can now print a cell with <A HREF='../doc/cell.htm'>Cell()</A>. A cell is a rectangular area, possibly framed,
|
||||
which contains some text. It is output at the current position. We specify its dimensions,
|
||||
its text (centered or aligned), if borders should be drawn, and where the current position
|
||||
moves after it (to the right, below or to the beginning of the next line). To add a frame, we would do this:
|
||||
<BR>
|
||||
<BR>
|
||||
<TABLE WIDTH="100%" STYLE="color:#4040C0; border-style:ridge" BORDERCOLORLIGHT="#B0B0E0" BORDERCOLORDARK="#000000" BORDER="2" CELLPADDING=6 CELLSPACING=0 BGCOLOR="#F0F5FF"><TR><TD style="border-width:0px">
|
||||
<NOBR><code><font color="#000000">
|
||||
$pdf<font class="kw">-></font>Cell<font class="kw">(</font>40<font class="kw">,</font>10<font class="kw">,</font><font class="str">'Hello World !'</font><font class="kw">,</font>1<font class="kw">);</font><br>
|
||||
</font>
|
||||
</code></NOBR></TD></TR></TABLE><P></P>
|
||||
To add a new cell next to it with centered text and go to the next line, we would do:
|
||||
<BR>
|
||||
<BR>
|
||||
<TABLE WIDTH="100%" STYLE="color:#4040C0; border-style:ridge" BORDERCOLORLIGHT="#B0B0E0" BORDERCOLORDARK="#000000" BORDER="2" CELLPADDING=6 CELLSPACING=0 BGCOLOR="#F0F5FF"><TR><TD style="border-width:0px">
|
||||
<NOBR><code><font color="#000000">
|
||||
$pdf<font class="kw">-></font>Cell<font class="kw">(</font>60<font class="kw">,</font>10<font class="kw">,</font><font class="str">'Powered by FPDF.'</font><font class="kw">,</font>0<font class="kw">,</font>1<font class="kw">,</font><font class="str">'C'</font><font class="kw">);</font><br>
|
||||
</font>
|
||||
</code></NOBR></TD></TR></TABLE><P></P>
|
||||
Remark : the line break can also be done with <A HREF='../doc/ln.htm'>Ln()</A>. This method allows to specify
|
||||
in addition the height of the break.
|
||||
<BR>
|
||||
<BR>
|
||||
Finally, the document is closed and sent to the browser with <A HREF='../doc/output.htm'>Output()</A>. We could have saved
|
||||
it in a file by passing the desired file name.
|
||||
<BR>
|
||||
<BR>
|
||||
Caution: in case when the PDF is sent to the browser, nothing else must be output, not before
|
||||
nor after (the least space or carriage return matters). If you send some data before, you will
|
||||
get the error message: "Some data has already been output to browser, can't send PDF file". If
|
||||
you send after, your browser may display a blank page.
|
||||
</BODY>
|
||||
</HTML>
|
9
standort/prints/#alt/tutorial/tuto1.php
Normal file
9
standort/prints/#alt/tutorial/tuto1.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
require('../fpdf.php');
|
||||
|
||||
$pdf=new FPDF();
|
||||
$pdf->AddPage();
|
||||
$pdf->SetFont('Arial','B',16);
|
||||
$pdf->Cell(40,10,'Hello World!');
|
||||
$pdf->Output();
|
||||
?>
|
50
standort/prints/#alt/tutorial/tuto2.htm
Normal file
50
standort/prints/#alt/tutorial/tuto2.htm
Normal file
@ -0,0 +1,50 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
|
||||
<TITLE>Header, footer, page break and image</TITLE>
|
||||
<LINK TYPE="text/css" REL="stylesheet" HREF="../fpdf.css">
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H2>Header, footer, page break and image</H2>
|
||||
Here is a two page example with header, footer and logo:
|
||||
<BR>
|
||||
<BR>
|
||||
<TABLE WIDTH="100%" STYLE="color:#4040C0; border-style:ridge" BORDERCOLORLIGHT="#B0B0E0" BORDERCOLORDARK="#000000" BORDER="2" CELLPADDING=6 CELLSPACING=0 BGCOLOR="#F0F5FF"><TR><TD style="border-width:0px">
|
||||
<NOBR><code><font color="#000000">
|
||||
<?php<br><font class="kw">require(</font><font class="str">'fpdf.php'</font><font class="kw">);<br><br>class </font>PDF <font class="kw">extends </font>FPDF<br><font class="kw">{<br></font><font class="cmt">//Page header<br></font><font class="kw">function </font>Header<font class="kw">()<br>{<br> </font><font class="cmt">//Logo<br> </font>$<font class="kw">this-></font>Image<font class="kw">(</font><font class="str">'logo_pb.png'</font><font class="kw">,</font>10<font class="kw">,</font>8<font class="kw">,</font>33<font class="kw">);<br> </font><font class="cmt">//Arial bold 15<br> </font>$<font class="kw">this-></font>SetFont<font class="kw">(</font><font class="str">'Arial'</font><font class="kw">,</font><font class="str">'B'</font><font class="kw">,</font>15<font class="kw">);<br> </font><font class="cmt">//Move to the right<br> </font>$<font class="kw">this-></font>Cell<font class="kw">(</font>80<font class="kw">);<br> </font><font class="cmt">//Title<br> </font>$<font class="kw">this-></font>Cell<font class="kw">(</font>30<font class="kw">,</font>10<font class="kw">,</font><font class="str">'Title'</font><font class="kw">,</font>1<font class="kw">,</font>0<font class="kw">,</font><font class="str">'C'</font><font class="kw">);<br> </font><font class="cmt">//Line break<br> </font>$<font class="kw">this-></font>Ln<font class="kw">(</font>20<font class="kw">);<br>}<br><br></font><font class="cmt">//Page footer<br></font><font class="kw">function </font>Footer<font class="kw">()<br>{<br> </font><font class="cmt">//Position at 1.5 cm from bottom<br> </font>$<font class="kw">this-></font>SetY<font class="kw">(-</font>15<font class="kw">);<br> </font><font class="cmt">//Arial italic 8<br> </font>$<font class="kw">this-></font>SetFont<font class="kw">(</font><font class="str">'Arial'</font><font class="kw">,</font><font class="str">'I'</font><font class="kw">,</font>8<font class="kw">);<br> </font><font class="cmt">//Page number<br> </font>$<font class="kw">this-></font>Cell<font class="kw">(</font>0<font class="kw">,</font>10<font class="kw">,</font><font class="str">'Page '</font><font class="kw">.</font>$<font class="kw">this-></font>PageNo<font class="kw">().</font><font class="str">'/{nb}'</font><font class="kw">,</font>0<font class="kw">,</font>0<font class="kw">,</font><font class="str">'C'</font><font class="kw">);<br>}<br>}<br><br></font><font class="cmt">//Instanciation of inherited class<br></font>$pdf<font class="kw">=new </font>PDF<font class="kw">();<br></font>$pdf<font class="kw">-></font>AliasNbPages<font class="kw">();<br></font>$pdf<font class="kw">-></font>AddPage<font class="kw">();<br></font>$pdf<font class="kw">-></font>SetFont<font class="kw">(</font><font class="str">'Times'</font><font class="kw">,</font><font class="str">''</font><font class="kw">,</font>12<font class="kw">);<br>for(</font>$i<font class="kw">=</font>1<font class="kw">;</font>$i<font class="kw"><=</font>40<font class="kw">;</font>$i<font class="kw">++)<br> </font>$pdf<font class="kw">-></font>Cell<font class="kw">(</font>0<font class="kw">,</font>10<font class="kw">,</font><font class="str">'Printing line number '</font><font class="kw">.</font>$i<font class="kw">,</font>0<font class="kw">,</font>1<font class="kw">);<br></font>$pdf<font class="kw">-></font>Output<font class="kw">();<br></font>?>
|
||||
</font>
|
||||
</code></NOBR></TD></TR></TABLE><P></P>
|
||||
<SCRIPT>
|
||||
<!--
|
||||
if(document.location.href.indexOf('http:')==0)
|
||||
{
|
||||
document.write("<P CLASS='demo'><A HREF='tuto2.php' TARGET='_blank' CLASS='demo'>[Demo]</A></P>");
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
This example makes use of the <A HREF='../doc/header.htm'>Header()</A> and <A HREF='../doc/footer.htm'>Footer()</A> methods to process page headers and
|
||||
footers. They are called automatically. They already exist in the FPDF class but do nothing,
|
||||
therefore we have to extend the class and override them.
|
||||
<BR>
|
||||
<BR>
|
||||
The logo is printed with the <A HREF='../doc/image.htm'>Image()</A> method by specifying its upper-left corner and
|
||||
its width. The height is calculated automatically to respect the image proportions.
|
||||
<BR>
|
||||
<BR>
|
||||
To print the page number, a null value is passed as the cell width. It means that the cell
|
||||
should extend up to the right margin of the page; it is handy to center text. The current page
|
||||
number is returned by the <A HREF='../doc/pageno.htm'>PageNo()</A> method; as for the total number of pages, it is obtained
|
||||
by means of the special value <TT>{nb}</TT> which will be substituted on document closure
|
||||
(provided you first called <A HREF='../doc/aliasnbpages.htm'>AliasNbPages()</A>).
|
||||
<BR>
|
||||
Note the use of the <A HREF='../doc/sety.htm'>SetY()</A> method which allows to set position at an absolute location in
|
||||
the page, starting from the top or the bottom.
|
||||
<BR>
|
||||
<BR>
|
||||
Another interesting feature is used here: the automatic page breaking. As soon as a cell would
|
||||
cross a limit in the page (at 2 centimeters from the bottom by default), a break is performed
|
||||
and the font restored. Although the header and footer select their own font (Arial), the body
|
||||
continues with Times. This mechanism of automatic restoration also applies to colors and line
|
||||
width. The limit which triggers page breaks can be set with <A HREF='../doc/setautopagebreak.htm'>SetAutoPageBreak()</A>.
|
||||
</BODY>
|
||||
</HTML>
|
41
standort/prints/#alt/tutorial/tuto2.php
Normal file
41
standort/prints/#alt/tutorial/tuto2.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
require('../fpdf.php');
|
||||
|
||||
class PDF extends FPDF
|
||||
{
|
||||
//Page header
|
||||
function Header()
|
||||
{
|
||||
//Logo
|
||||
$this->Image('logo_pb.png',10,8,33);
|
||||
//Arial bold 15
|
||||
$this->SetFont('Arial','B',15);
|
||||
//Move to the right
|
||||
$this->Cell(80);
|
||||
//Title
|
||||
$this->Cell(30,10,'Title',1,0,'C');
|
||||
//Line break
|
||||
$this->Ln(20);
|
||||
}
|
||||
|
||||
//Page footer
|
||||
function Footer()
|
||||
{
|
||||
//Position at 1.5 cm from bottom
|
||||
$this->SetY(-15);
|
||||
//Arial italic 8
|
||||
$this->SetFont('Arial','I',8);
|
||||
//Page number
|
||||
$this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');
|
||||
}
|
||||
}
|
||||
|
||||
//Instanciation of inherited class
|
||||
$pdf=new PDF();
|
||||
$pdf->AliasNbPages();
|
||||
$pdf->AddPage();
|
||||
$pdf->SetFont('Times','',12);
|
||||
for($i=1;$i<=40;$i++)
|
||||
$pdf->Cell(0,10,'Printing line number '.$i,0,1);
|
||||
$pdf->Output();
|
||||
?>
|
43
standort/prints/#alt/tutorial/tuto3.htm
Normal file
43
standort/prints/#alt/tutorial/tuto3.htm
Normal file
File diff suppressed because one or more lines are too long
83
standort/prints/#alt/tutorial/tuto3.php
Normal file
83
standort/prints/#alt/tutorial/tuto3.php
Normal file
@ -0,0 +1,83 @@
|
||||
<?php
|
||||
require('../fpdf.php');
|
||||
|
||||
class PDF extends FPDF
|
||||
{
|
||||
function Header()
|
||||
{
|
||||
global $title;
|
||||
|
||||
//Arial bold 15
|
||||
$this->SetFont('Arial','B',15);
|
||||
//Calculate width of title and position
|
||||
$w=$this->GetStringWidth($title)+6;
|
||||
$this->SetX((210-$w)/2);
|
||||
//Colors of frame, background and text
|
||||
$this->SetDrawColor(0,80,180);
|
||||
$this->SetFillColor(230,230,0);
|
||||
$this->SetTextColor(220,50,50);
|
||||
//Thickness of frame (1 mm)
|
||||
$this->SetLineWidth(1);
|
||||
//Title
|
||||
$this->Cell($w,9,$title,1,1,'C',1);
|
||||
//Line break
|
||||
$this->Ln(10);
|
||||
}
|
||||
|
||||
function Footer()
|
||||
{
|
||||
//Position at 1.5 cm from bottom
|
||||
$this->SetY(-15);
|
||||
//Arial italic 8
|
||||
$this->SetFont('Arial','I',8);
|
||||
//Text color in gray
|
||||
$this->SetTextColor(128);
|
||||
//Page number
|
||||
$this->Cell(0,10,'Page '.$this->PageNo(),0,0,'C');
|
||||
}
|
||||
|
||||
function ChapterTitle($num,$label)
|
||||
{
|
||||
//Arial 12
|
||||
$this->SetFont('Arial','',12);
|
||||
//Background color
|
||||
$this->SetFillColor(200,220,255);
|
||||
//Title
|
||||
$this->Cell(0,6,"Chapter $num : $label",0,1,'L',1);
|
||||
//Line break
|
||||
$this->Ln(4);
|
||||
}
|
||||
|
||||
function ChapterBody($file)
|
||||
{
|
||||
//Read text file
|
||||
$f=fopen($file,'r');
|
||||
$txt=fread($f,filesize($file));
|
||||
fclose($f);
|
||||
//Times 12
|
||||
$this->SetFont('Times','',12);
|
||||
//Output justified text
|
||||
$this->MultiCell(0,5,$txt);
|
||||
//Line break
|
||||
$this->Ln();
|
||||
//Mention in italics
|
||||
$this->SetFont('','I');
|
||||
$this->Cell(0,5,'(end of excerpt)');
|
||||
}
|
||||
|
||||
function PrintChapter($num,$title,$file)
|
||||
{
|
||||
$this->AddPage();
|
||||
$this->ChapterTitle($num,$title);
|
||||
$this->ChapterBody($file);
|
||||
}
|
||||
}
|
||||
|
||||
$pdf=new PDF();
|
||||
$title='20000 Leagues Under the Seas';
|
||||
$pdf->SetTitle($title);
|
||||
$pdf->SetAuthor('Jules Verne');
|
||||
$pdf->PrintChapter(1,'A RUNAWAY REEF','20k_c1.txt');
|
||||
$pdf->PrintChapter(2,'THE PROS AND CONS','20k_c2.txt');
|
||||
$pdf->Output();
|
||||
?>
|
34
standort/prints/#alt/tutorial/tuto4.htm
Normal file
34
standort/prints/#alt/tutorial/tuto4.htm
Normal file
File diff suppressed because one or more lines are too long
113
standort/prints/#alt/tutorial/tuto4.php
Normal file
113
standort/prints/#alt/tutorial/tuto4.php
Normal file
@ -0,0 +1,113 @@
|
||||
<?php
|
||||
require('../fpdf.php');
|
||||
|
||||
class PDF extends FPDF
|
||||
{
|
||||
//Current column
|
||||
var $col=0;
|
||||
//Ordinate of column start
|
||||
var $y0;
|
||||
|
||||
function Header()
|
||||
{
|
||||
//Page header
|
||||
global $title;
|
||||
|
||||
$this->SetFont('Arial','B',15);
|
||||
$w=$this->GetStringWidth($title)+6;
|
||||
$this->SetX((210-$w)/2);
|
||||
$this->SetDrawColor(0,80,180);
|
||||
$this->SetFillColor(230,230,0);
|
||||
$this->SetTextColor(220,50,50);
|
||||
$this->SetLineWidth(1);
|
||||
$this->Cell($w,9,$title,1,1,'C',1);
|
||||
$this->Ln(10);
|
||||
//Save ordinate
|
||||
$this->y0=$this->GetY();
|
||||
}
|
||||
|
||||
function Footer()
|
||||
{
|
||||
//Page footer
|
||||
$this->SetY(-15);
|
||||
$this->SetFont('Arial','I',8);
|
||||
$this->SetTextColor(128);
|
||||
$this->Cell(0,10,'Page '.$this->PageNo(),0,0,'C');
|
||||
}
|
||||
|
||||
function SetCol($col)
|
||||
{
|
||||
//Set position at a given column
|
||||
$this->col=$col;
|
||||
$x=10+$col*65;
|
||||
$this->SetLeftMargin($x);
|
||||
$this->SetX($x);
|
||||
}
|
||||
|
||||
function AcceptPageBreak()
|
||||
{
|
||||
//Method accepting or not automatic page break
|
||||
if($this->col<2)
|
||||
{
|
||||
//Go to next column
|
||||
$this->SetCol($this->col+1);
|
||||
//Set ordinate to top
|
||||
$this->SetY($this->y0);
|
||||
//Keep on page
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
//Go back to first column
|
||||
$this->SetCol(0);
|
||||
//Page break
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function ChapterTitle($num,$label)
|
||||
{
|
||||
//Title
|
||||
$this->SetFont('Arial','',12);
|
||||
$this->SetFillColor(200,220,255);
|
||||
$this->Cell(0,6,"Chapter $num : $label",0,1,'L',1);
|
||||
$this->Ln(4);
|
||||
//Save ordinate
|
||||
$this->y0=$this->GetY();
|
||||
}
|
||||
|
||||
function ChapterBody($fichier)
|
||||
{
|
||||
//Read text file
|
||||
$f=fopen($fichier,'r');
|
||||
$txt=fread($f,filesize($fichier));
|
||||
fclose($f);
|
||||
//Font
|
||||
$this->SetFont('Times','',12);
|
||||
//Output text in a 6 cm width column
|
||||
$this->MultiCell(60,5,$txt);
|
||||
$this->Ln();
|
||||
//Mention
|
||||
$this->SetFont('','I');
|
||||
$this->Cell(0,5,'(end of excerpt)');
|
||||
//Go back to first column
|
||||
$this->SetCol(0);
|
||||
}
|
||||
|
||||
function PrintChapter($num,$title,$file)
|
||||
{
|
||||
//Add chapter
|
||||
$this->AddPage();
|
||||
$this->ChapterTitle($num,$title);
|
||||
$this->ChapterBody($file);
|
||||
}
|
||||
}
|
||||
|
||||
$pdf=new PDF();
|
||||
$title='20000 Leagues Under the Seas';
|
||||
$pdf->SetTitle($title);
|
||||
$pdf->SetAuthor('Jules Verne');
|
||||
$pdf->PrintChapter(1,'A RUNAWAY REEF','20k_c1.txt');
|
||||
$pdf->PrintChapter(2,'THE PROS AND CONS','20k_c2.txt');
|
||||
$pdf->Output();
|
||||
?>
|
43
standort/prints/#alt/tutorial/tuto5.htm
Normal file
43
standort/prints/#alt/tutorial/tuto5.htm
Normal file
File diff suppressed because one or more lines are too long
101
standort/prints/#alt/tutorial/tuto5.php
Normal file
101
standort/prints/#alt/tutorial/tuto5.php
Normal file
@ -0,0 +1,101 @@
|
||||
<?php
|
||||
require('../fpdf.php');
|
||||
|
||||
class PDF extends FPDF
|
||||
{
|
||||
//Load data
|
||||
function LoadData($file)
|
||||
{
|
||||
//Read file lines
|
||||
$lines=file($file);
|
||||
$data=array();
|
||||
foreach($lines as $line)
|
||||
$data[]=explode(';',chop($line));
|
||||
return $data;
|
||||
}
|
||||
|
||||
//Simple table
|
||||
function BasicTable($header,$data)
|
||||
{
|
||||
//Header
|
||||
foreach($header as $col)
|
||||
$this->Cell(40,7,$col,1);
|
||||
$this->Ln();
|
||||
//Data
|
||||
foreach($data as $row)
|
||||
{
|
||||
foreach($row as $col)
|
||||
$this->Cell(40,6,$col,1);
|
||||
$this->Ln();
|
||||
}
|
||||
}
|
||||
|
||||
//Better table
|
||||
function ImprovedTable($header,$data)
|
||||
{
|
||||
//Column widths
|
||||
$w=array(40,35,40,45);
|
||||
//Header
|
||||
for($i=0;$i<count($header);$i++)
|
||||
$this->Cell($w[$i],7,$header[$i],1,0,'C');
|
||||
$this->Ln();
|
||||
//Data
|
||||
foreach($data as $row)
|
||||
{
|
||||
$this->Cell($w[0],6,$row[0],'LR');
|
||||
$this->Cell($w[1],6,$row[1],'LR');
|
||||
$this->Cell($w[2],6,number_format($row[2]),'LR',0,'R');
|
||||
$this->Cell($w[3],6,number_format($row[3]),'LR',0,'R');
|
||||
$this->Ln();
|
||||
}
|
||||
//Closure line
|
||||
$this->Cell(array_sum($w),0,'','T');
|
||||
}
|
||||
|
||||
//Colored table
|
||||
function FancyTable($header,$data)
|
||||
{
|
||||
//Colors, line width and bold font
|
||||
$this->SetFillColor(255,0,0);
|
||||
$this->SetTextColor(255);
|
||||
$this->SetDrawColor(128,0,0);
|
||||
$this->SetLineWidth(.3);
|
||||
$this->SetFont('','B');
|
||||
//Header
|
||||
$w=array(40,35,40,45);
|
||||
for($i=0;$i<count($header);$i++)
|
||||
$this->Cell($w[$i],7,$header[$i],1,0,'C',1);
|
||||
$this->Ln();
|
||||
//Color and font restoration
|
||||
$this->SetFillColor(224,235,255);
|
||||
$this->SetTextColor(0);
|
||||
$this->SetFont('');
|
||||
//Data
|
||||
$fill=0;
|
||||
foreach($data as $row)
|
||||
{
|
||||
$this->Cell($w[0],6,$row[0],'LR',0,'L',$fill);
|
||||
$this->Cell($w[1],6,$row[1],'LR',0,'L',$fill);
|
||||
$this->Cell($w[2],6,number_format($row[2]),'LR',0,'R',$fill);
|
||||
$this->Cell($w[3],6,number_format($row[3]),'LR',0,'R',$fill);
|
||||
$this->Ln();
|
||||
$fill=!$fill;
|
||||
}
|
||||
$this->Cell(array_sum($w),0,'','T');
|
||||
}
|
||||
}
|
||||
|
||||
$pdf=new PDF();
|
||||
//Column titles
|
||||
$header=array('Country','Capital','Area (sq km)','Pop. (thousands)');
|
||||
//Data loading
|
||||
$data=$pdf->LoadData('countries.txt');
|
||||
$pdf->SetFont('Arial','',14);
|
||||
$pdf->AddPage();
|
||||
$pdf->BasicTable($header,$data);
|
||||
$pdf->AddPage();
|
||||
$pdf->ImprovedTable($header,$data);
|
||||
$pdf->AddPage();
|
||||
$pdf->FancyTable($header,$data);
|
||||
$pdf->Output();
|
||||
?>
|
68
standort/prints/#alt/tutorial/tuto6.htm
Normal file
68
standort/prints/#alt/tutorial/tuto6.htm
Normal file
File diff suppressed because one or more lines are too long
122
standort/prints/#alt/tutorial/tuto6.php
Normal file
122
standort/prints/#alt/tutorial/tuto6.php
Normal file
@ -0,0 +1,122 @@
|
||||
<?php
|
||||
require('../fpdf.php');
|
||||
|
||||
class PDF extends FPDF
|
||||
{
|
||||
var $B;
|
||||
var $I;
|
||||
var $U;
|
||||
var $HREF;
|
||||
|
||||
function PDF($orientation='P',$unit='mm',$format='A4')
|
||||
{
|
||||
//Call parent constructor
|
||||
$this->FPDF($orientation,$unit,$format);
|
||||
//Initialization
|
||||
$this->B=0;
|
||||
$this->I=0;
|
||||
$this->U=0;
|
||||
$this->HREF='';
|
||||
}
|
||||
|
||||
function WriteHTML($html)
|
||||
{
|
||||
//HTML parser
|
||||
$html=str_replace("\n",' ',$html);
|
||||
$a=preg_split('/<(.*)>/U',$html,-1,PREG_SPLIT_DELIM_CAPTURE);
|
||||
foreach($a as $i=>$e)
|
||||
{
|
||||
if($i%2==0)
|
||||
{
|
||||
//Text
|
||||
if($this->HREF)
|
||||
$this->PutLink($this->HREF,$e);
|
||||
else
|
||||
$this->Write(5,$e);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Tag
|
||||
if($e{0}=='/')
|
||||
$this->CloseTag(strtoupper(substr($e,1)));
|
||||
else
|
||||
{
|
||||
//Extract attributes
|
||||
$a2=explode(' ',$e);
|
||||
$tag=strtoupper(array_shift($a2));
|
||||
$attr=array();
|
||||
foreach($a2 as $v)
|
||||
if(ereg('^([^=]*)=["\']?([^"\']*)["\']?$',$v,$a3))
|
||||
$attr[strtoupper($a3[1])]=$a3[2];
|
||||
$this->OpenTag($tag,$attr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function OpenTag($tag,$attr)
|
||||
{
|
||||
//Opening tag
|
||||
if($tag=='B' or $tag=='I' or $tag=='U')
|
||||
$this->SetStyle($tag,true);
|
||||
if($tag=='A')
|
||||
$this->HREF=$attr['HREF'];
|
||||
if($tag=='BR')
|
||||
$this->Ln(5);
|
||||
}
|
||||
|
||||
function CloseTag($tag)
|
||||
{
|
||||
//Closing tag
|
||||
if($tag=='B' or $tag=='I' or $tag=='U')
|
||||
$this->SetStyle($tag,false);
|
||||
if($tag=='A')
|
||||
$this->HREF='';
|
||||
}
|
||||
|
||||
function SetStyle($tag,$enable)
|
||||
{
|
||||
//Modify style and select corresponding font
|
||||
$this->$tag+=($enable ? 1 : -1);
|
||||
$style='';
|
||||
foreach(array('B','I','U') as $s)
|
||||
if($this->$s>0)
|
||||
$style.=$s;
|
||||
$this->SetFont('',$style);
|
||||
}
|
||||
|
||||
function PutLink($URL,$txt)
|
||||
{
|
||||
//Put a hyperlink
|
||||
$this->SetTextColor(0,0,255);
|
||||
$this->SetStyle('U',true);
|
||||
$this->Write(5,$txt,$URL);
|
||||
$this->SetStyle('U',false);
|
||||
$this->SetTextColor(0);
|
||||
}
|
||||
}
|
||||
|
||||
$html='You can now easily print text mixing different
|
||||
styles : <B>bold</B>, <I>italic</I>, <U>underlined</U>, or
|
||||
<B><I><U>all at once</U></I></B>!<BR>You can also insert links
|
||||
on text, such as <A HREF="http://www.fpdf.org">www.fpdf.org</A>,
|
||||
or on an image: click on the logo.';
|
||||
|
||||
$pdf=new PDF();
|
||||
//First page
|
||||
$pdf->AddPage();
|
||||
$pdf->SetFont('Arial','',20);
|
||||
$pdf->Write(5,'To find out what\'s new in this tutorial, click ');
|
||||
$pdf->SetFont('','U');
|
||||
$link=$pdf->AddLink();
|
||||
$pdf->Write(5,'here',$link);
|
||||
$pdf->SetFont('');
|
||||
//Second page
|
||||
$pdf->AddPage();
|
||||
$pdf->SetLink($link);
|
||||
$pdf->Image('logo.png',10,10,30,0,'','http://www.fpdf.org');
|
||||
$pdf->SetLeftMargin(45);
|
||||
$pdf->SetFontSize(14);
|
||||
$pdf->WriteHTML($html);
|
||||
$pdf->Output();
|
||||
?>
|
315
standort/prints/#alt/tutorial/tuto7.htm
Normal file
315
standort/prints/#alt/tutorial/tuto7.htm
Normal file
@ -0,0 +1,315 @@
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
|
||||
<TITLE>Adding new fonts and encoding support</TITLE>
|
||||
<LINK TYPE="text/css" REL="stylesheet" HREF="../fpdf.css">
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<H2>Adding new fonts and encoding support</H2>
|
||||
This tutorial explains how to use TrueType or Type1 fonts so that you are not limited to the standard
|
||||
fonts any more. The other interest is that you can choose the font encoding, which allows you to
|
||||
use other languages than the Western ones (the standard fonts having too few available characters).
|
||||
<BR>
|
||||
<BR>
|
||||
There are two ways to use a new font: embedding it in the PDF or not. When a font is not
|
||||
embedded, it is sought in the system. The advantage is that the PDF file is lighter; on the other
|
||||
hand, if it is not available, a substitution font is used. So it is preferable to ensure that the
|
||||
needed font is installed on the client systems. If the file is to be viewed by a large audience,
|
||||
it is better to embed.
|
||||
<BR>
|
||||
<BR>
|
||||
Adding a new font requires three steps for TrueTypes:
|
||||
<UL>
|
||||
<LI>Generation of the metric file (.afm)
|
||||
<LI>Generation of the font definition file (.php)
|
||||
<LI>Declaration of the font in the script
|
||||
</UL>
|
||||
For Type1, the first one is theoretically not necessary because the AFM file is usually shipped
|
||||
with the font. In case you have only a metric file in PFM format, use the convertor available
|
||||
<A HREF="http://www.fpdf.org/fr/dl.php?id=34">here</A>.
|
||||
<H4 CLASS='st'>Generation of the metric file</H4>
|
||||
The first step for a TrueType consists in generating the AFM file. A utility exists to do this
|
||||
task: <A HREF="http://ttf2pt1.sourceforge.net" TARGET="_blank">ttf2pt1</A>. The Windows binary
|
||||
is available <A HREF="http://www.fpdf.org/fr/dl.php?id=22">here</A>. The command line to use is
|
||||
the following:
|
||||
<BR>
|
||||
<BR>
|
||||
<TT>ttf2pt1 -a font.ttf font</TT>
|
||||
<BR>
|
||||
<BR>
|
||||
For example, for Comic Sans MS Regular:
|
||||
<BR>
|
||||
<BR>
|
||||
<TT>ttf2pt1 -a c:\windows\fonts\comic.ttf comic</TT>
|
||||
<BR>
|
||||
<BR>
|
||||
Two files are created; the one we are interested in is comic.afm.
|
||||
<H4 CLASS='st'>Generation of the font definition file</H4>
|
||||
The second step consists in generating a PHP file containing all the information needed by FPDF;
|
||||
in addition, the font file is compressed. To do this, a helper script is provided in the font/makefont/
|
||||
directory of the package: makefont.php. It contains the following function:
|
||||
<BR>
|
||||
<BR>
|
||||
<TT>MakeFont(<B>string</B> fontfile, <B>string</B> afmfile [, <B>string</B> enc [, <B>array</B> patch [, <B>string</B> type]]])</TT>
|
||||
<BR>
|
||||
<BR>
|
||||
<TT><U>fontfile</U></TT>
|
||||
<BLOCKQUOTE>
|
||||
Path to the .ttf or .pfb file.
|
||||
</BLOCKQUOTE>
|
||||
<TT><U>afmfile</U></TT>
|
||||
<BLOCKQUOTE>
|
||||
Path to the .afm file.
|
||||
</BLOCKQUOTE>
|
||||
<TT><U>enc</U></TT>
|
||||
<BLOCKQUOTE>
|
||||
Name of the encoding to use. Default value: <TT>cp1252</TT>.
|
||||
</BLOCKQUOTE>
|
||||
<TT><U>patch</U></TT>
|
||||
<BLOCKQUOTE>
|
||||
Optional modification of the encoding. Empty by default.
|
||||
</BLOCKQUOTE>
|
||||
<TT><U>type</U></TT>
|
||||
<BLOCKQUOTE>
|
||||
Type of the font (<TT>TrueType</TT> or <TT>Type1</TT>). Default value: <TT>TrueType</TT>.
|
||||
</BLOCKQUOTE>
|
||||
<BR>
|
||||
The first parameter is the name of the font file. The extension must be either .ttf or .pfb and
|
||||
determines the font type. If you own a Type1 font in ASCII format (.pfa), you can convert it to
|
||||
binary format with <A HREF="http://www.lcdf.org/~eddietwo/type/#t1utils" TARGET="_blank">t1utils</A>.
|
||||
<BR>
|
||||
If you don't want to embed the font, pass an empty string. In this case, type is given by the
|
||||
<TT>type</TT> parameter.
|
||||
<BR>
|
||||
Note: in the case of a font with the same name as a standard one, for instance arial.ttf, it is
|
||||
mandatory to embed. If you don't, Acrobat will use its own font.
|
||||
<BR>
|
||||
<BR>
|
||||
The AFM file is the one previously generated.
|
||||
<BR>
|
||||
<BR>
|
||||
The encoding defines the association between a code (from 0 to 255) and a character. The first
|
||||
128 are fixed and correspond to ASCII; the following are variable. The encodings are stored in
|
||||
.map files. Those available are:
|
||||
<UL>
|
||||
<LI>cp1250 (Central Europe)
|
||||
<LI>cp1251 (Cyrillic)
|
||||
<LI>cp1252 (Western Europe)
|
||||
<LI>cp1253 (Greek)
|
||||
<LI>cp1254 (Turkish)
|
||||
<LI>cp1255 (Hebrew)
|
||||
<LI>cp1257 (Baltic)
|
||||
<LI>cp1258 (Vietnamese)
|
||||
<LI>cp874 (Thai)
|
||||
<LI>ISO-8859-1 (Western Europe)
|
||||
<LI>ISO-8859-2 (Central Europe)
|
||||
<LI>ISO-8859-4 (Baltic)
|
||||
<LI>ISO-8859-5 (Cyrillic)
|
||||
<LI>ISO-8859-7 (Greek)
|
||||
<LI>ISO-8859-9 (Turkish)
|
||||
<LI>ISO-8859-11 (Thai)
|
||||
<LI>ISO-8859-15 (Western Europe)
|
||||
<LI>ISO-8859-16 (Central Europe)
|
||||
<LI>KOI8-R (Russian)
|
||||
<LI>KOI8-U (Ukrainian)
|
||||
</UL>
|
||||
Of course, the font must contain the characters corresponding to the chosen encoding.
|
||||
<BR>
|
||||
In the particular case of a symbolic font (that is to say which does not contain letters, such
|
||||
as Symbol or ZapfDingbats), pass an empty string.
|
||||
<BR>
|
||||
The encodings which begin with cp are those used by Windows; Linux systems usually use ISO.
|
||||
<BR>
|
||||
Remark: the standard fonts use cp1252.
|
||||
<BR>
|
||||
<BR>
|
||||
The fourth parameter gives the possibility to alter the encoding. Sometimes you may want to add
|
||||
some characters. For instance, ISO-8859-1 does not contain the euro symbol. To add it at position
|
||||
164, pass <TT>array(164=>'Euro')</TT>.
|
||||
<BR>
|
||||
<BR>
|
||||
The last parameter is used to give the type of the font in case it is not embedded (that is to
|
||||
say the first parameter is empty).
|
||||
<BR>
|
||||
<BR>
|
||||
After you have called the function (create a new file for this and include makefont.php, or
|
||||
simply add the call directly inside), a .php file is created, with the same name as the .afm one.
|
||||
You may rename it if you wish. If the case of embedding, the font file is compressed and gives a
|
||||
second file with .z as extension (except if the compression function is not available, it
|
||||
requires zlib). You may rename it too, but in this case you have to alter the variable <TT>$file</TT>
|
||||
in the .php file accordingly.
|
||||
<BR>
|
||||
<BR>
|
||||
Example:
|
||||
<BR>
|
||||
<BR>
|
||||
<TT>MakeFont('c:\\windows\\fonts\\comic.ttf','comic.afm','cp1252');</TT>
|
||||
<BR>
|
||||
<BR>
|
||||
which gives the files comic.php and comic.z.
|
||||
<BR>
|
||||
<BR>
|
||||
Then you have to copy the generated file(s) to the font directory. If the font file
|
||||
could not be compressed, copy the .ttf or .pfb instead of the .z.
|
||||
<H4 CLASS='st'>Declaration of the font in the script</H4>
|
||||
The last step is the most simple. You just need to call the <A HREF='../doc/addfont.htm'>AddFont()</A> method. For instance:
|
||||
<BR>
|
||||
<BR>
|
||||
<TABLE WIDTH="100%" STYLE="color:#4040C0; border-style:ridge" BORDERCOLORLIGHT="#B0B0E0" BORDERCOLORDARK="#000000" BORDER="2" CELLPADDING=6 CELLSPACING=0 BGCOLOR="#F0F5FF"><TR><TD style="border-width:0px">
|
||||
<NOBR><code><font color="#000000">
|
||||
$pdf<font class="kw">-></font>AddFont<font class="kw">(</font><font class="str">'Comic'</font><font class="kw">,</font><font class="str">''</font><font class="kw">,</font><font class="str">'comic.php'</font><font class="kw">);</font><br>
|
||||
</font>
|
||||
</code></NOBR></TD></TR></TABLE><P></P>
|
||||
or simply:
|
||||
<BR>
|
||||
<BR>
|
||||
<TABLE WIDTH="100%" STYLE="color:#4040C0; border-style:ridge" BORDERCOLORLIGHT="#B0B0E0" BORDERCOLORDARK="#000000" BORDER="2" CELLPADDING=6 CELLSPACING=0 BGCOLOR="#F0F5FF"><TR><TD style="border-width:0px">
|
||||
<NOBR><code><font color="#000000">
|
||||
$pdf<font class="kw">-></font>AddFont<font class="kw">(</font><font class="str">'Comic'</font><font class="kw">);</font><br>
|
||||
</font>
|
||||
</code></NOBR></TD></TR></TABLE><P></P>
|
||||
And the font is now available (in regular and underlined styles), usable like the others. If we
|
||||
had worked with Comic Sans MS Bold (comicbd.ttf), we would have put:
|
||||
<BR>
|
||||
<BR>
|
||||
<TABLE WIDTH="100%" STYLE="color:#4040C0; border-style:ridge" BORDERCOLORLIGHT="#B0B0E0" BORDERCOLORDARK="#000000" BORDER="2" CELLPADDING=6 CELLSPACING=0 BGCOLOR="#F0F5FF"><TR><TD style="border-width:0px">
|
||||
<NOBR><code><font color="#000000">
|
||||
$pdf<font class="kw">-></font>AddFont<font class="kw">(</font><font class="str">'Comic'</font><font class="kw">,</font><font class="str">'B'</font><font class="kw">,</font><font class="str">'comicbd.php'</font><font class="kw">);</font><br>
|
||||
</font>
|
||||
</code></NOBR></TD></TR></TABLE><P></P>
|
||||
<H4 CLASS='st'>Example</H4>
|
||||
Let's now see a small complete example. The font used is Calligrapher, available at
|
||||
<A HREF="http://www.abstractfonts.com/fonts/" TARGET="_blank">www.abstractfonts.com</A> (a site
|
||||
offering numerous free TrueType fonts). The first step is the generation of the AFM file:
|
||||
<BR>
|
||||
<BR>
|
||||
<TT>ttf2pt1 -a calligra.ttf calligra</TT>
|
||||
<BR>
|
||||
<BR>
|
||||
which gives calligra.afm (and calligra.t1a that we can delete). Then we generate the definition
|
||||
file:
|
||||
<BR>
|
||||
<BR>
|
||||
<TABLE WIDTH="100%" STYLE="color:#4040C0; border-style:ridge" BORDERCOLORLIGHT="#B0B0E0" BORDERCOLORDARK="#000000" BORDER="2" CELLPADDING=6 CELLSPACING=0 BGCOLOR="#F0F5FF"><TR><TD style="border-width:0px">
|
||||
<NOBR><code><font color="#000000">
|
||||
<?php<br><font class="kw">require(</font><font class="str">'font/makefont/makefont.php'</font><font class="kw">);<br><br></font>MakeFont<font class="kw">(</font><font class="str">'calligra.ttf'</font><font class="kw">,</font><font class="str">'calligra.afm'</font><font class="kw">);<br></font>?>
|
||||
</font>
|
||||
</code></NOBR></TD></TR></TABLE><P></P>
|
||||
The function call gives the following report:
|
||||
<BR>
|
||||
<BR>
|
||||
<B>Warning:</B> character Euro is missing<BR>
|
||||
<B>Warning:</B> character Zcaron is missing<BR>
|
||||
<B>Warning:</B> character zcaron is missing<BR>
|
||||
<B>Warning:</B> character eth 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 is too old). Three other characters are missing
|
||||
too, but we are not interested in them anyway.
|
||||
<BR>
|
||||
We can now copy the two files to the font directory and write the script:
|
||||
<BR>
|
||||
<BR>
|
||||
<TABLE WIDTH="100%" STYLE="color:#4040C0; border-style:ridge" BORDERCOLORLIGHT="#B0B0E0" BORDERCOLORDARK="#000000" BORDER="2" CELLPADDING=6 CELLSPACING=0 BGCOLOR="#F0F5FF"><TR><TD style="border-width:0px">
|
||||
<NOBR><code><font color="#000000">
|
||||
<?php<br><font class="kw">require(</font><font class="str">'fpdf.php'</font><font class="kw">);<br><br></font>$pdf<font class="kw">=new </font>FPDF<font class="kw">();<br></font>$pdf<font class="kw">-></font>AddFont<font class="kw">(</font><font class="str">'Calligrapher'</font><font class="kw">,</font><font class="str">''</font><font class="kw">,</font><font class="str">'calligra.php'</font><font class="kw">);<br></font>$pdf<font class="kw">-></font>AddPage<font class="kw">();<br></font>$pdf<font class="kw">-></font>SetFont<font class="kw">(</font><font class="str">'Calligrapher'</font><font class="kw">,</font><font class="str">''</font><font class="kw">,</font>35<font class="kw">);<br></font>$pdf<font class="kw">-></font>Cell<font class="kw">(</font>0<font class="kw">,</font>10<font class="kw">,</font><font class="str">'Enjoy new fonts with FPDF!'</font><font class="kw">);<br></font>$pdf<font class="kw">-></font>Output<font class="kw">();<br></font>?>
|
||||
</font>
|
||||
</code></NOBR></TD></TR></TABLE><P></P>
|
||||
<SCRIPT>
|
||||
<!--
|
||||
if(document.location.href.indexOf('http:')==0)
|
||||
{
|
||||
document.write("<P CLASS='demo'><A HREF='tuto7.php' TARGET='_blank' CLASS='demo'>[Demo]</A></P>");
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<H4 CLASS='st'>About the euro symbol</H4>
|
||||
The euro character is not present in all encodings, and is not always placed at the same position:
|
||||
<BR>
|
||||
<BR>
|
||||
<STYLE>
|
||||
TH {text-align:left; background:#E0EBFF}
|
||||
TH, TD {padding-left:10px; padding-right:10px; border-bottom-width:0px; border-left-width:1px; border-right-width:0px; border-top-width:1px}
|
||||
TR.alt0 {background:#FFFFEE}
|
||||
TR.alt1 {background:#FFFFDF}
|
||||
</STYLE>
|
||||
<TABLE STYLE="margin-left:15px; border-style:outset" BORDER="2" CELLSPACING="0" CELLPADDING="2" BGCOLOR2="#FFFFEE">
|
||||
<TR><TH CLASS="st">Encoding</TH><TH CLASS="st">Position</TH></TR>
|
||||
<TR CLASS="alt0"><TD>cp1250</TD><TD>128<BR></TD></TR>
|
||||
<TR CLASS="alt1"><TD>cp1251</TD><TD>136<BR></TD></TR>
|
||||
<TR CLASS="alt0"><TD>cp1252</TD><TD>128<BR></TD></TR>
|
||||
<TR CLASS="alt1"><TD>cp1253</TD><TD>128<BR></TD></TR>
|
||||
<TR CLASS="alt0"><TD>cp1254</TD><TD>128<BR></TD></TR>
|
||||
<TR CLASS="alt1"><TD>cp1255</TD><TD>128<BR></TD></TR>
|
||||
<TR CLASS="alt0"><TD>cp1257</TD><TD>128<BR></TD></TR>
|
||||
<TR CLASS="alt1"><TD>cp1258</TD><TD>128<BR></TD></TR>
|
||||
<TR CLASS="alt0"><TD>cp874</TD><TD>128<BR></TD></TR>
|
||||
<TR CLASS="alt1"><TD>ISO-8859-1</TD><TD>absent<BR></TD></TR>
|
||||
<TR CLASS="alt0"><TD>ISO-8859-2</TD><TD>absent<BR></TD></TR>
|
||||
<TR CLASS="alt1"><TD>ISO-8859-4</TD><TD>absent<BR></TD></TR>
|
||||
<TR CLASS="alt0"><TD>ISO-8859-5</TD><TD>absent<BR></TD></TR>
|
||||
<TR CLASS="alt1"><TD>ISO-8859-7</TD><TD>absent<BR></TD></TR>
|
||||
<TR CLASS="alt0"><TD>ISO-8859-9</TD><TD>absent<BR></TD></TR>
|
||||
<TR CLASS="alt1"><TD>ISO-8859-11</TD><TD>absent<BR></TD></TR>
|
||||
<TR CLASS="alt0"><TD>ISO-8859-15</TD><TD>164<BR></TD></TR>
|
||||
<TR CLASS="alt1"><TD>ISO-8859-16</TD><TD>164<BR></TD></TR>
|
||||
<TR CLASS="alt0"><TD>KOI8-R</TD><TD>absent<BR></TD></TR>
|
||||
<TR CLASS="alt1"><TD>KOI8-U</TD><TD>absent<BR></TD></TR>
|
||||
</TABLE>
|
||||
<BR>
|
||||
ISO-8859-1 is widespread but does not include the euro sign. If you need it, the simplest thing
|
||||
to do is using cp1252 or ISO-8859-15 instead, which are nearly identical but contain the precious
|
||||
symbol.
|
||||
<BR>
|
||||
As for ISO-8859-2, it is possible to use ISO-8859-16 instead, but it contains many differences.
|
||||
It is therefore simpler to patch the encoding to add the symbol to it, as explained above. The
|
||||
same is true for the other encodings.
|
||||
<H4 CLASS='st'>Font synthesis under Windows</H4>
|
||||
When a TrueType font is not available in a given style, Windows is able to synthesize it from the
|
||||
regular version. For instance, there is no Comic Sans MS Italic, but it can be built from Comic
|
||||
Sans MS Regular. This feature can be used in a PDF file, but unfortunately requires that the
|
||||
regular font be present in the system (you must not embed it). Here is how to do it:
|
||||
<UL>
|
||||
<LI>Generate the definition file for the regular font without embedding (you may rename it to
|
||||
reflect the desired style)
|
||||
<LI>Open it and append to the variable <TT>$name</TT> a comma followed by the desired style
|
||||
(<TT>Italic</TT>, <TT>Bold</TT> or <TT>BoldItalic</TT>)
|
||||
</UL>
|
||||
For instance, for the file comici.php:
|
||||
<BR>
|
||||
<BR>
|
||||
<TT>$name='ComicSansMS,Italic';</TT>
|
||||
<BR>
|
||||
<BR>
|
||||
It can then be used normally:
|
||||
<BR>
|
||||
<BR>
|
||||
<TABLE WIDTH="100%" STYLE="color:#4040C0; border-style:ridge" BORDERCOLORLIGHT="#B0B0E0" BORDERCOLORDARK="#000000" BORDER="2" CELLPADDING=6 CELLSPACING=0 BGCOLOR="#F0F5FF"><TR><TD style="border-width:0px">
|
||||
<NOBR><code><font color="#000000">
|
||||
$pdf<font class="kw">-></font>AddFont<font class="kw">(</font><font class="str">'Comic'</font><font class="kw">,</font><font class="str">'I'</font><font class="kw">,</font><font class="str">'comici.php'</font><font class="kw">);</font><br>
|
||||
</font>
|
||||
</code></NOBR></TD></TR></TABLE><P></P>
|
||||
<H4 CLASS='st'>Reducing the size of TrueType fonts</H4>
|
||||
Font files are often quite voluminous (more than 100, even 200KB); this is due to the fact that
|
||||
they contain the characters corresponding to many encodings. zlib compression reduces them but
|
||||
they remain fairly big. A technique exists to reduce them further. It consists in converting the
|
||||
font to the Type1 format with ttf2pt1 by specifying the encoding you are interested in; all other
|
||||
characters will be discarded.
|
||||
<BR>
|
||||
For instance, the arial.ttf font shipped with Windows 98 is 267KB (it contains 1296 characters).
|
||||
After compression it gives 147. Let's convert it to Type1 by keeping only cp1250 characters:
|
||||
<BR>
|
||||
<BR>
|
||||
<TT>ttf2pt1 -b -L cp1250.map c:\windows\fonts\arial.ttf arial</TT>
|
||||
<BR>
|
||||
<BR>
|
||||
The .map files are located in the font/makefont/ directory of the package. The command produces
|
||||
arial.pfb and arial.afm. The arial.pfb file is only 35KB, and 30KB after compression.
|
||||
<BR>
|
||||
<BR>
|
||||
It is possible to go even further. If you are interested only by a subset of the encoding (you
|
||||
probably don't need all 217 characters), you can open the .map file and remove the lines you are
|
||||
not interested in. This will reduce the file size accordingly.
|
||||
</BODY>
|
||||
</HTML>
|
11
standort/prints/#alt/tutorial/tuto7.php
Normal file
11
standort/prints/#alt/tutorial/tuto7.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
define('FPDF_FONTPATH','./');
|
||||
require('../fpdf.php');
|
||||
|
||||
$pdf=new FPDF();
|
||||
$pdf->AddFont('Calligrapher','','calligra.php');
|
||||
$pdf->AddPage();
|
||||
$pdf->SetFont('Calligrapher','',35);
|
||||
$pdf->Cell(0,10,'Enjoy new fonts with FPDF!');
|
||||
$pdf->Output();
|
||||
?>
|
Reference in New Issue
Block a user