mirror of
https://github.com/foliojs/pdfkit.git
synced 2025-12-08 20:15:54 +00:00
Update docs
This commit is contained in:
parent
6b2bea9835
commit
7a2f2d243c
@ -85,9 +85,9 @@ The output is as you'd expect:
|
||||
That's all there is to creating PDF documents in PDFKit. It's really quite
|
||||
simple to create beautiful multi-page printable documents using Node.js!
|
||||
|
||||
This guide was actually generated from Markdown/Literate CoffeeScript files using a
|
||||
This guide was generated from Markdown/Literate CoffeeScript files using a
|
||||
PDFKit generation script. The examples are actually run to generate the output shown
|
||||
inline. The script generates both the website and the PDF guide, and
|
||||
inline. The script generates both the website and the PDF guide, and
|
||||
can be found [on Github](http://github.com/devongovett/pdfkit/tree/master/docs/generate.coffee).
|
||||
Check it out if you want to see an example of a slightly more complicated renderer using
|
||||
a parser for Markdown and a syntax highlighter.
|
||||
|
||||
@ -91,6 +91,7 @@ below.
|
||||
* `underline` - whether to underline the text
|
||||
* `strike` - whether to strike out the text
|
||||
* `continued` - whether the text segment will be followed immediately by another segment. Useful for changing styling in the middle of a paragraph.
|
||||
* `features` - an array of [OpenType feature tags](https://www.microsoft.com/typography/otspec/featuretags.htm) to apply. If not provided, a set of defaults is used.
|
||||
|
||||
Additionally, the fill and stroke color and opacity methods described in the
|
||||
[vector graphics section](vector.html) are applied to text content as well.
|
||||
@ -139,14 +140,14 @@ Here is the output:
|
||||
The PDF format defines 14 standard fonts that can be used in PDF documents (4
|
||||
styles of Helvetica, Courier, and Times, as well as Symbol and Zapf Dingbats),
|
||||
but also allows fonts to be embedded right in the document. PDFKit supports
|
||||
embedding font files in the TrueType (`.ttf`), TrueType Collection (`.ttc`),
|
||||
and Datafork TrueType (`.dfont`) formats.
|
||||
embedding TrueType (`.ttf`), OpenType (`.otf`), WOFF, WOFF2, TrueType Collection (`.ttc`),
|
||||
and Datafork TrueType (`.dfont`) fonts.
|
||||
|
||||
To change the font used to render text, just call the `font` method. If you
|
||||
are using a standard PDF font, just pass the name to the `font` method.
|
||||
Otherwise, pass the path to the font file, or a `Buffer` containing the font data.
|
||||
If the font is a collection font (`.ttc` and `.dfont` files), meaning that it
|
||||
contains multiple styles in the same file, you should pass the name of the style
|
||||
If the font is a collection font (`.ttc` and `.dfont` files), meaning that it
|
||||
contains multiple styles in the same file, you should pass the name of the style
|
||||
to be extracted from the collection.
|
||||
|
||||
Here is an example showing how to set the font in each case.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user