Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Signed-off-by: Glenn Lewis <6598971+gmlewis@users.noreply.github.com>
  • Loading branch information
gmlewis committed May 2, 2024
1 parent c91db80 commit 2cda737
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,22 @@ import (
Then render the text to polygons and use them however you want:

```go
render, err := fonts.Text(xPos, yPos, xScale, yScale, message, "ubuntumonoregular", Center)
xPos, yPos, xScale, yScale := 0.0, 0.0, 1.0, 1.0
message := "Sample from ubuntumonoregular"
render, err := fonts.Text(xPos, yPos, xScale, yScale, message, "ubuntumonoregular", &fonts.Center)
if err != nil {
return err
log.Fatal(err)
}
log.Printf("MBB: %v", render.MBB)
for _, poly := range render.Polygons {
for i, poly := range render.Polygons {
log.Printf("Polygon #%v/%v has %v points. MBB: %v", i+1, len(render.Polygons), len(poly.Pts), poly.MBB)
// ...
}
```

See https://github.com/gmlewis/go-gerber for an example application
that uses this package.
See https://github.com/gmlewis/go-gerber
or https://github.com/gmlewis/blackjack
for example applications that use this package.

----------------------------------------------------------------------

Expand Down Expand Up @@ -334,8 +338,8 @@ limitations under the License.
[![latoregular](images/sample_latoregular.png)](fonts/latoregular)
[![leaguescriptthin_regular](images/sample_leaguescriptthin_regular.png)](fonts/leaguescriptthin_regular)
[![ledger_regular](images/sample_ledger_regular.png)](fonts/ledger_regular)
[![leland](images/sample_leland.png)](fonts/leland)
[![lelandtext](images/sample_lelandtext.png)](fonts/lelandtext)
[leland](fonts/leland)
[lelandtext](fonts/lelandtext)
[![librebaskerville_bold](images/sample_librebaskerville_bold.png)](fonts/librebaskerville_bold)
[![librebaskerville_italic](images/sample_librebaskerville_italic.png)](fonts/librebaskerville_italic)
[![librebaskerville_regular](images/sample_librebaskerville_regular.png)](fonts/librebaskerville_regular)
Expand Down

0 comments on commit 2cda737

Please sign in to comment.