Skip to main content

Crate f_office

Crate f_office 

Source
Expand description

Public API of F-Office.

F-Office renders Office Open XML documents the way Microsoft Office does, starting with Word’s DOCX format. This crate opens a file and lays it out into a display list, which f-office-raster draws as pixels, or writes it as a PDF file. The other f-office-* crates are internal and have no stability promise before 1.0.

Modules§

configuration
The configuration: the setup of Word’s machine and the user’s choice of fonts, and the types of its keys. The configuration: the setup of Word’s machine that changes its pages (its printer, its time zone, the separators of its numbers and its fonts) and the user’s choice of the family that draws a family on this computer, and nothing else. Word’s behaviors and numbers are the target’s profile, which no configuration sets.
docx
The warnings of the DOCX layout, which Warning::Docx holds, and the types of their fields.
edit
Edits of a DOCX file: a list of edits, made all or none (apply), each of which names the file as it was before the list. A raw edit names an element of any XML part by its path (XmlEdit); a named edit names a block of the body by its address (NamedEdit), and the DOCX crate makes it into splices of the main document part, and for a comment or an image also of the parts that it changes, with the parts that it adds (f_office_docx::named_edits).
pdf
The warnings of the PDF writer, which Warning::Pdf holds.

Structs§

Address
The path by which a reader names an element of a story (Address): p12 for the twelfth paragraph of the body, t2/r4/c1/p1 for the first paragraph of the first cell of the fourth row of the second table, t2/r4 for that row, p5/b1/p2 for the second paragraph of the first text box of the fifth paragraph, and h1/p3 for the third paragraph of the first header part. Its grammar is
ArtPictures
The pictures of the art page borders that a caller gives, by art style and size. An empty set, the default, draws no art border: the layout leaves each side of an art style out, with a warning (crate::Warning::ArtBorderNotDrawn).
ArtPicturesError
Why a file of art pictures does not read, and on which line.
CellPlace
The table cell that a placed line lies in, each number from 1.
Configuration
The configuration of a layout: the target, and the setup of Word’s machine and the fonts.
DateTime
A local date and time.
DisplayList
The pages of one rendered document.
Document
A DOCX file opened and laid out once for a target: its display list, which an output draws or writes, the places of its lines, and the text blocks of its body. It holds no state of the parse or the layout: what the layout left out or drew in another way comes out of Document::open beside it.
FidelityReport
Complete typed rendering fidelity report for a laid-out document.
FontDatabase
Font faces loaded from bytes, addressed by FontId.
FontStatus
Resolution details for one font family requested by the document.
LayoutContinuation
Resumable layout continuation driving remaining pages of an incrementally opened Document.
LayoutProgress
Progress summary returned by Document::begin_open_prepared and LayoutContinuation::step.
Length
A length in half-EMUs, which is 1/25,400 of a point.
Limits
Limits that protect the reader against hostile packages: those of the ZIP file, and those of each XML part, which the package keeps for the readers of its parts (Package::limits). Start from Limits::default and set the limits that differ, so that a new limit breaks no caller.
LineTurn
How the upright frame of a turned line lies on the page (Line turn): a point of the frame lands on the page at to, plus its offset from from turned by turn.
MissingGlyphGroup
Missing (.notdef) characters grouped by font and coarse Unicode block, with zero raw text.
Name
A name that a file chooses and a warning keeps, such as a part’s name in its package or a font family that a document asks for: at most Name::MAX_CHARS characters of it, without the characters that a terminal or a log does not show as themselves (control characters and the marks that change the direction or the joining of text).
NumberSeparators
The decimal separator and the group separator that a machine writes in numbers, such as . and , in 1,234.5.
NumberSeparatorsError
A text that is no pair of number separators.
Omission
Counted summary of one category of rendering omission or approximation.
Options
Choices for opening a document that the document itself does not make. Start from Options::default and set the fields that differ, so that a new field breaks no caller. The default lays out for the default target with its defaults.
Page
One page.
PreparedDocument
A DOCX file opened and parsed once, ready for fast font discovery and incremental layout.
StoryBookmark
A bookmark that starts in a paragraph’s story text (Story bookmark), at a byte of it.
StoryLink
A hyperlink in a paragraph’s story text (Story link): the bytes of the text that show it, from its first to its last glyph, where it goes and its tooltip.
StoryParagraph
A paragraph of a story’s text (Story text): the texts of its laid out lines joined, so that a field gives its shown result, a list label is given as drawn, hidden text is left out and an automatic hyphen is not in it.
Target
The product whose pages a layout reproduces. The default target is Word for Windows (word-win). Preview targets (word-mac, word-web) are gated behind the preview-targets feature.
TextBlock
A paragraph or a table of the body, as a reader of the document lists it (Text block).
TextCluster
A cluster of a line’s text: one glyph or a tab with the ligature parts and combining marks that join it, the bytes of the line’s text that it shows, and its edges on the page.
TextLine
A line of a page’s text map: its story and paragraph, its range of the paragraph’s text, its line box and its clusters.
XmlLimits
The limits of each XML part, which Limits::xml holds. Limits that protect the reader against hostile input. Start from Limits::default and set the limits that differ, so that a new limit breaks no caller.

Enums§

AddressError
Why a text does not read as an address. Each error’s text names the fix.
AddressStep
One step of an address: the story that it starts in, or the place of a block, a row, a cell or a text box among its kind, from 1.
ArtPicturesFault
What is wrong with a file of art pictures.
ConfigurationError
Why a target’s ID names no target, or the configuration or the target’s profile does not read: the error of Target::from_str and of Error::Configuration. Why a target’s ID names no target, or the configuration or the target’s profile does not read. An error in a target’s name, a profile or a configuration.
EndHyphen
A hyphen that a line shows at its end where a word breaks, which the text does not hold.
Error
Why a document could not be rendered.
FidelityLevel
Overall rendering fidelity of a laid-out document.
FontMatchKind
How a font family requested by the document was resolved for rendering.
ImageFault
Why an output leaves an image of the display list out.
ImageFormat
The format of an image file.
LineTextEnd
How a line ends.
LinkTarget
Where a hyperlink goes (Link target).
OmissionKind
Category of non-font rendering omission or approximation.
TextBlockKind
What a text block is.
TextStory
A story of the text map (Story): text that reads on by itself, and that a selection stays in. The stories of one page compare in their reading order: the header, the body, the endnotes, the frames, the text boxes, the footnotes and the footer, and the frames and the text boxes each in the order of their layout.
Warning
What a rendering left out of the file, or drew in another way than the file asks, while it went on with the rest. A warning holds no content of the document, only the names that the file uses to point at a part or a font, cut and with printable characters only (Name).

Constants§

ART_PICTURES_BYTE_LIMIT
The most bytes that one call of ArtPictures::add reads: 32 MiB.
ART_PICTURES_CLIP_DEPTH_LIMIT
The most clips of an art picture that can hold one shape, one inside another.
ART_PICTURES_COMMAND_LIMIT
The most commands in the outline of one shape of an art picture: its moves, lines, curves and closes.
ART_PICTURES_REACH_LIMIT
How far a point of an art picture may lie from its part’s box: four boxes.
ART_PICTURES_SHAPE_LIMIT
The most items in one part of an art picture: its shapes and the starts and ends of its clips.
ART_PICTURES_SIZE_LIMIT
The largest size of an art border, in points, of which a picture can be given: the largest w:sz of an art side that the schema’s byte holds.

Traits§

RandomAccessRead
Random-access byte source for opening a crate::Package without copying the entire ZIP archive into memory (for example, backed by a browser Blob/File.slice() or OPFS FileSystemSyncAccessHandle).

Functions§

error_chain
The error chain of error: its own text, then the text of each cause that source gives, joined by : . Each error of F-Office writes only its own text and gives its cause through source, so a place that shows an error to a person writes this, so that the cause stays visible.

Type Aliases§

Warned
The value of a call with its warnings.
Warnings
The warnings of a call, each distinct warning once with the number of times it came.