Skip to content

Commit

Permalink
Tweak text documentation
Browse files Browse the repository at this point in the history
- Use serif font for example, as sans-serif is default
- Describe where it is implemented
  • Loading branch information
noelwelsh committed Aug 4, 2024
1 parent 907bce3 commit a084183
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/src/main/scala/pictures/Text.scala
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ object Text {
val font =
Picture
.text("Change the font")
.font(Font.defaultSansSerif.bold.size(FontSize.points(24)))
.font(Font.defaultSerif.bold.size(FontSize.points(24)))

font.save("pictures/font.png")
}
9 changes: 7 additions & 2 deletions docs/src/pages/pictures/text.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ The output is shown below.
}

In addition to creating pictures containing text, it also allows specifying the @:api(doodle.core.Font) used for the text, via the `font` method.
In this example we use the default sans-serif font, in bold weight and 24 point size.
In this example we use the default serif font, in bold weight and 24 point size.

```scala mdoc:silent
import doodle.core.font.{Font, FontSize}

val font =
Picture
.text("Change the font")
.font(Font.defaultSansSerif.bold.size(FontSize.points(24)))
.font(Font.defaultSerif.bold.size(FontSize.points(24)))
```

This produces the picture below.
Expand All @@ -41,3 +41,8 @@ This produces the picture below.
alt = A picture showing the text "Change the font"
title = "Change the font"
}


## Implementation

These methods are available on both the @:api(doodle.algebra.Text) algebra and @:api(doodle.image.Image).

0 comments on commit a084183

Please sign in to comment.