Skip to content

Commit

Permalink
add font option
Browse files Browse the repository at this point in the history
  • Loading branch information
timrs2998 committed Jun 23, 2024
1 parent cd558ae commit 0a42fba
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repositories {
}

dependencies {
implementation("com.github.timrs2998:pdf-builder:2.0.0")
implementation("com.github.timrs2998:pdf-builder:2.1.0")
implementation("org.apache.pdfbox:pdfbox:3.0.0")
}
```
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugins {

group = "com.github.timrs2998"

version = "2.0.1"
version = "2.1.0"

description = "PDF builder written in Kotlin with a statically typed DSL"

Expand Down
3 changes: 2 additions & 1 deletion src/main/kotlin/com/github/timrs2998/pdfbuilder/Element.kt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ abstract class Element(open val parent: Element?) {
var fontSize: Float? = null
var horizontalAlignment: Alignment? = null
var fontName: FontName? = null
var font: PDType1Font? = null
var wrap: Wrap? = null

/**
Expand Down Expand Up @@ -83,7 +84,7 @@ abstract class Element(open val parent: Element?) {
}

internal val inheritedPdFont: PDType1Font by lazy {
fontName?.let { PDType1Font(it) } ?: parent?.inheritedPdFont ?: FALLBACK_PD_FONT
font ?: fontName?.let { PDType1Font(it) } ?: parent?.inheritedPdFont ?: FALLBACK_PD_FONT
}

internal val inheritedWrap: Wrap by lazy { wrap ?: parent?.wrap ?: FALLBACK_WRAP }
Expand Down

0 comments on commit 0a42fba

Please sign in to comment.