Skip to content

Commit

Permalink
Document text lines
Browse files Browse the repository at this point in the history
  • Loading branch information
dwarring committed Dec 7, 2024
1 parent 8eec829 commit d68942b
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ docs/%.md : lib/%.rakumod
Pod-To-Markdown-installed :
@raku -M Pod::To::Markdown -c

doc : $(DocLinker) Pod-To-Markdown-installed docs/index.md docs/PDF/Content.md docs/PDF/Content/Canvas.md docs/PDF/Content/Ops.md docs/PDF/Content/Image.md docs/PDF/Content/Font/CoreFont.md docs/PDF/Content/Text/Box.md docs/PDF/Content/Color.md docs/PDF/Content/Tag.md docs/PDF/Content/PageTree.md docs/PDF/Content/Text/Box.md docs/PDF/Content/Text/Style.md
doc : $(DocLinker) Pod-To-Markdown-installed docs/index.md docs/PDF/Content.md docs/PDF/Content/Canvas.md docs/PDF/Content/Ops.md docs/PDF/Content/Image.md docs/PDF/Content/Font/CoreFont.md docs/PDF/Content/Color.md docs/PDF/Content/Tag.md docs/PDF/Content/PageTree.md docs/PDF/Content/Text/Box.md docs/PDF/Content/Text/Style.md docs/PDF/Content/Text/Line.md

docs/index.md : README.md
cp $< $@
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ as listed in the [PDF::API6 Graphics Documentation](https://pdf-raku.github.io/P

- [PDF::Content::Text::Style](https://pdf-raku.github.io/PDF-Content-raku/PDF/Content/Text/Style) text styling class for text boxes.

- [PDF::Content::Text::Line](https://pdf-raku.github.io/PDF-Content-raku/PDF/Content/Text/Line) an individual text box line.

- [PDF::Content::Color](https://pdf-raku.github.io/PDF-Content-raku/PDF/Content/Color) A module of color construction functions

- [PDF::Content::Tag](https://pdf-raku.github.io/PDF-Content-raku/PDF/Content/Tag) Tagged content detection and construction
Expand Down
12 changes: 0 additions & 12 deletions docs/PDF/Content/Font/CoreFont.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,6 @@ say $font.stringwidth("RVX", :kern); # 2111
Methods
-------

### method core-font-name

```raku
method core-font-name(
Str:D $family,
Str :$weight,
Str :$style
) returns Str
```

get a core font name for the given family, weight and style

### multi method height

```raku
Expand Down
4 changes: 4 additions & 0 deletions docs/PDF/Content/Text/Box.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ Vertical alignment of mutiple-line text boxes: `top`, `center`, or `bottom`.

See also the :baseline` option for vertical displacememnt of the first line of text.

### method lines

An array of [PDF::Content::Text::Line](https://pdf-raku.github.io/PDF-Content-raku/PDF/Content/Text/Line) objects.

style
-----

Expand Down
47 changes: 47 additions & 0 deletions docs/PDF/Content/Text/Line.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[[Raku PDF Project]](https://pdf-raku.github.io)
/ [[PDF-Content Module]](https://pdf-raku.github.io/PDF-Content-raku)
/ [PDF::Content](https://pdf-raku.github.io/PDF-Content-raku/PDF/Content)
:: Text
:: [Line](https://pdf-raku.github.io/PDF-Content-raku/PDF/Content/Text/Line)

class PDF::Content::Text::Line
------------------------------

A single line of a text box

Description
-----------

This class represents a single line of output in a [PDF::Content::Text::Box](https://pdf-raku.github.io/PDF-Content-raku/PDF/Content/Text/Box).

Methods
-------

### method decoded

An input list of text atoms

### method encoded

An list of font encodings

### method height

Height of the line.

### method word-gap

Spacing between words.

### method indent

indentation offset.

### method align

Alignment offset

### has Numeric $.word-gap

sum of word widths

2 changes: 2 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ as listed in the [PDF::API6 Graphics Documentation](https://pdf-raku.github.io/P

- [PDF::Content::Text::Style](https://pdf-raku.github.io/PDF-Content-raku/PDF/Content/Text/Style) text styling class for text boxes.

- [PDF::Content::Text::Line](https://pdf-raku.github.io/PDF-Content-raku/PDF/Content/Text/Line) an individual text box line.

- [PDF::Content::Color](https://pdf-raku.github.io/PDF-Content-raku/PDF/Content/Color) A module of color construction functions

- [PDF::Content::Tag](https://pdf-raku.github.io/PDF-Content-raku/PDF/Content/Tag) Tagged content detection and construction
Expand Down
4 changes: 4 additions & 0 deletions lib/PDF/Content/Text/Box.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ be used to replace the text contained in a text box.
=para See also the :baseline` option for vertical displacememnt of the first line of text.
=head3 method lines
=para An array of L<PDF::Content::Text::Line> objects.
use PDF::Content::Text::Style;
use PDF::Content::Text::Line;
use PDF::Content::Ops :OpCode, :TextMode;
Expand Down
30 changes: 30 additions & 0 deletions lib/PDF/Content/Text/Line.rakumod
Original file line number Diff line number Diff line change
@@ -1,6 +1,36 @@
#| A single line of a text box
unit class PDF::Content::Text::Line;

=head2 Description
=para This class represents a single line of output in a L<PDF::Content::Text::Box>.
=head2 Methods
=head3 method decoded
=para An input list of text atoms
=head3 method encoded
=para An list of font encodings
=head3 method height
=para Height of the line.
=head3 method word-gap
=para Spacing between words.
=head3 method indent
=para indentation offset.
=head3 method align
=para Alignment offset
use PDF::Content::Ops :OpCode;
use Method::Also;

Expand Down

0 comments on commit d68942b

Please sign in to comment.