Skip to content

Commit

Permalink
Change font size to 24
Browse files Browse the repository at this point in the history
  • Loading branch information
smelc committed Jan 15, 2020
1 parent c2c3810 commit 4e1e7f9
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 7 deletions.
12 changes: 6 additions & 6 deletions cardgen/src/commonMain/kotlin/card/card.kt
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,26 @@ fun Stage.putBorder(cdi: CardDrawingInput) {
}
}

/** @return The tile's y */
/** @return The tile's bottom y */
fun Stage.putCreatureTile(cdi: CardDrawingInput): Double {
val imgx = (width - (cdi.cbmp.width * creatureScale)) / 2;
val imgxCenter = imgx + (cdi.cbmp.width / 2)
val imgy = (height - (cdi.cbmp.height * creatureScale)) / 8;
val imgyCenter = imgy + (cdi.cbmp.height / 2)
image(cdi.cbmp) {
val img = image(cdi.cbmp) {
position(imgx, imgy)
scale = creatureScale
smoothing = false
}
return imgy
return imgy + img.height
}

/**
* @param tiley The creature's tile y
* @param tileboty The creature's tile bottom y
* @return The text's y
*/
fun Stage.putCreatureName(cdi: CardDrawingInput, tiley: Double): Double {
val texty = tiley + cdi.cbmp.height / 2 + (cdi.font.fontSize * 2)
fun Stage.putCreatureName(cdi: CardDrawingInput, tileboty: Double): Double {
val texty = tileboty
val w = width

text(cdi.creature.name, font = cdi.font, textSize = cdi.font.fontSize.toDouble(), color = cdi.creature.team.color) {
Expand Down
2 changes: 1 addition & 1 deletion cardgen/src/commonMain/kotlin/main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ suspend fun main() = Korge(width = (24 * 9), height = ((24 * 4) + 12) * 3, bgcol
val tiles = Tile.loadFromDisk(dataJson, resourcesVfs["tiles.png"].readBitmap())
val creatures = Creature.loadFromDisk(dataJson, resourcesVfs["creatures.png"].readBitmap())

val font = resourcesVfs["romulus_medium_32.fnt"].readBitmapFont()
val font = resourcesVfs["romulus_medium_24.fnt"].readBitmapFont()

for ((i, p) in creatures.withIndex()) {
prepareCard(p.first, p.second, font, tiles)
Expand Down
98 changes: 98 additions & 0 deletions cardgen/src/commonMain/resources/romulus_medium_24.fnt
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
info face="Romulus" size=24 bold=0 italic=0 smooth=1 spacing=0,0
common lineHeight=30 base=22 scaleW=256 scaleH=128 pages=1
page id=0 file="romulus_medium_24.png"
char id=32 x=1 y=17 width=0 height=0 xoffset=0 yoffset=22 xadvance=10 page=0
char id=33 x=2 y=3 width=4 height=14 xoffset=0 yoffset=8 xadvance=6 page=0
char id=34 x=7 y=3 width=10 height=6 xoffset=0 yoffset=8 xadvance=12 page=0
char id=35 x=18 y=3 width=14 height=14 xoffset=0 yoffset=8 xadvance=16 page=0
char id=36 x=33 y=1 width=12 height=18 xoffset=0 yoffset=6 xadvance=14 page=0
char id=37 x=46 y=3 width=16 height=14 xoffset=0 yoffset=8 xadvance=18 page=0
char id=38 x=63 y=3 width=14 height=14 xoffset=0 yoffset=8 xadvance=16 page=0
char id=39 x=78 y=3 width=4 height=6 xoffset=0 yoffset=8 xadvance=6 page=0
char id=40 x=83 y=1 width=6 height=18 xoffset=0 yoffset=6 xadvance=8 page=0
char id=41 x=90 y=1 width=6 height=18 xoffset=0 yoffset=6 xadvance=8 page=0
char id=42 x=97 y=3 width=6 height=8 xoffset=0 yoffset=8 xadvance=8 page=0
char id=43 x=104 y=5 width=12 height=10 xoffset=0 yoffset=10 xadvance=14 page=0
char id=44 x=117 y=13 width=4 height=8 xoffset=0 yoffset=18 xadvance=6 page=0
char id=45 x=122 y=11 width=8 height=2 xoffset=0 yoffset=16 xadvance=10 page=0
char id=46 x=131 y=13 width=4 height=4 xoffset=0 yoffset=18 xadvance=6 page=0
char id=47 x=136 y=3 width=16 height=14 xoffset=0 yoffset=8 xadvance=18 page=0
char id=48 x=153 y=3 width=12 height=14 xoffset=0 yoffset=8 xadvance=14 page=0
char id=49 x=166 y=3 width=8 height=14 xoffset=0 yoffset=8 xadvance=10 page=0
char id=50 x=175 y=3 width=12 height=14 xoffset=0 yoffset=8 xadvance=14 page=0
char id=51 x=188 y=3 width=12 height=14 xoffset=0 yoffset=8 xadvance=14 page=0
char id=52 x=201 y=3 width=12 height=14 xoffset=0 yoffset=8 xadvance=14 page=0
char id=53 x=214 y=3 width=12 height=14 xoffset=0 yoffset=8 xadvance=14 page=0
char id=54 x=227 y=3 width=12 height=14 xoffset=0 yoffset=8 xadvance=14 page=0
char id=55 x=240 y=3 width=12 height=14 xoffset=0 yoffset=8 xadvance=14 page=0
char id=56 x=1 y=22 width=12 height=14 xoffset=0 yoffset=8 xadvance=14 page=0
char id=57 x=14 y=22 width=12 height=14 xoffset=0 yoffset=8 xadvance=14 page=0
char id=58 x=27 y=24 width=4 height=12 xoffset=0 yoffset=10 xadvance=6 page=0
char id=59 x=32 y=24 width=4 height=16 xoffset=0 yoffset=10 xadvance=6 page=0
char id=60 x=37 y=22 width=10 height=14 xoffset=0 yoffset=8 xadvance=12 page=0
char id=61 x=48 y=26 width=12 height=6 xoffset=0 yoffset=12 xadvance=14 page=0
char id=62 x=61 y=22 width=10 height=14 xoffset=0 yoffset=8 xadvance=12 page=0
char id=63 x=72 y=22 width=12 height=14 xoffset=0 yoffset=8 xadvance=14 page=0
char id=64 x=85 y=22 width=18 height=18 xoffset=0 yoffset=8 xadvance=20 page=0
char id=65 x=104 y=22 width=12 height=14 xoffset=0 yoffset=8 xadvance=14 page=0
char id=66 x=117 y=22 width=14 height=14 xoffset=0 yoffset=8 xadvance=16 page=0
char id=67 x=132 y=22 width=14 height=14 xoffset=0 yoffset=8 xadvance=16 page=0
char id=68 x=147 y=22 width=14 height=14 xoffset=0 yoffset=8 xadvance=16 page=0
char id=69 x=162 y=22 width=14 height=14 xoffset=0 yoffset=8 xadvance=16 page=0
char id=70 x=177 y=22 width=14 height=14 xoffset=0 yoffset=8 xadvance=16 page=0
char id=71 x=192 y=22 width=14 height=14 xoffset=0 yoffset=8 xadvance=16 page=0
char id=72 x=207 y=22 width=16 height=14 xoffset=0 yoffset=8 xadvance=18 page=0
char id=73 x=224 y=22 width=8 height=14 xoffset=0 yoffset=8 xadvance=10 page=0
char id=74 x=233 y=22 width=12 height=14 xoffset=0 yoffset=8 xadvance=14 page=0
char id=75 x=1 y=41 width=16 height=14 xoffset=0 yoffset=8 xadvance=18 page=0
char id=76 x=18 y=41 width=12 height=14 xoffset=0 yoffset=8 xadvance=14 page=0
char id=77 x=31 y=41 width=20 height=14 xoffset=0 yoffset=8 xadvance=22 page=0
char id=78 x=52 y=41 width=18 height=14 xoffset=0 yoffset=8 xadvance=20 page=0
char id=79 x=71 y=41 width=14 height=14 xoffset=0 yoffset=8 xadvance=16 page=0
char id=80 x=86 y=41 width=14 height=14 xoffset=0 yoffset=8 xadvance=16 page=0
char id=81 x=101 y=41 width=14 height=18 xoffset=0 yoffset=8 xadvance=16 page=0
char id=82 x=116 y=41 width=16 height=14 xoffset=0 yoffset=8 xadvance=18 page=0
char id=83 x=133 y=41 width=12 height=14 xoffset=0 yoffset=8 xadvance=14 page=0
char id=84 x=146 y=41 width=12 height=14 xoffset=0 yoffset=8 xadvance=14 page=0
char id=85 x=159 y=41 width=18 height=14 xoffset=0 yoffset=8 xadvance=20 page=0
char id=86 x=178 y=41 width=18 height=14 xoffset=0 yoffset=8 xadvance=20 page=0
char id=87 x=197 y=41 width=20 height=14 xoffset=0 yoffset=8 xadvance=22 page=0
char id=88 x=218 y=41 width=16 height=14 xoffset=0 yoffset=8 xadvance=18 page=0
char id=89 x=235 y=41 width=16 height=14 xoffset=0 yoffset=8 xadvance=18 page=0
char id=90 x=1 y=60 width=12 height=14 xoffset=0 yoffset=8 xadvance=14 page=0
char id=91 x=14 y=60 width=6 height=16 xoffset=0 yoffset=8 xadvance=8 page=0
char id=92 x=21 y=60 width=16 height=14 xoffset=0 yoffset=8 xadvance=18 page=0
char id=93 x=38 y=60 width=6 height=16 xoffset=0 yoffset=8 xadvance=8 page=0
char id=94 x=45 y=60 width=14 height=8 xoffset=0 yoffset=8 xadvance=16 page=0
char id=95 x=60 y=72 width=12 height=2 xoffset=0 yoffset=20 xadvance=14 page=0
char id=96 x=73 y=60 width=6 height=4 xoffset=0 yoffset=8 xadvance=8 page=0
char id=97 x=80 y=64 width=14 height=10 xoffset=0 yoffset=12 xadvance=16 page=0
char id=98 x=95 y=60 width=14 height=14 xoffset=0 yoffset=8 xadvance=16 page=0
char id=99 x=110 y=64 width=10 height=10 xoffset=0 yoffset=12 xadvance=12 page=0
char id=100 x=121 y=60 width=14 height=14 xoffset=0 yoffset=8 xadvance=16 page=0
char id=101 x=136 y=64 width=12 height=10 xoffset=0 yoffset=12 xadvance=14 page=0
char id=102 x=149 y=60 width=10 height=14 xoffset=0 yoffset=8 xadvance=12 page=0
char id=103 x=160 y=64 width=14 height=14 xoffset=0 yoffset=12 xadvance=16 page=0
char id=104 x=175 y=60 width=14 height=14 xoffset=0 yoffset=8 xadvance=16 page=0
char id=105 x=190 y=60 width=8 height=14 xoffset=0 yoffset=8 xadvance=10 page=0
char id=106 x=199 y=60 width=6 height=18 xoffset=0 yoffset=8 xadvance=8 page=0
char id=107 x=206 y=60 width=14 height=14 xoffset=0 yoffset=8 xadvance=16 page=0
char id=108 x=221 y=60 width=8 height=14 xoffset=0 yoffset=8 xadvance=10 page=0
char id=109 x=230 y=64 width=18 height=10 xoffset=0 yoffset=12 xadvance=20 page=0
char id=110 x=1 y=83 width=16 height=10 xoffset=0 yoffset=12 xadvance=18 page=0
char id=111 x=18 y=83 width=12 height=10 xoffset=0 yoffset=12 xadvance=14 page=0
char id=112 x=31 y=83 width=14 height=14 xoffset=0 yoffset=12 xadvance=16 page=0
char id=113 x=46 y=83 width=14 height=14 xoffset=0 yoffset=12 xadvance=16 page=0
char id=114 x=61 y=83 width=12 height=10 xoffset=0 yoffset=12 xadvance=14 page=0
char id=115 x=74 y=83 width=10 height=10 xoffset=0 yoffset=12 xadvance=12 page=0
char id=116 x=85 y=81 width=8 height=12 xoffset=0 yoffset=10 xadvance=10 page=0
char id=117 x=94 y=83 width=14 height=10 xoffset=0 yoffset=12 xadvance=16 page=0
char id=118 x=109 y=83 width=14 height=10 xoffset=0 yoffset=12 xadvance=16 page=0
char id=119 x=124 y=83 width=18 height=10 xoffset=0 yoffset=12 xadvance=20 page=0
char id=120 x=143 y=83 width=14 height=10 xoffset=0 yoffset=12 xadvance=16 page=0
char id=121 x=158 y=83 width=14 height=14 xoffset=0 yoffset=12 xadvance=16 page=0
char id=122 x=173 y=83 width=12 height=10 xoffset=0 yoffset=12 xadvance=14 page=0
char id=123 x=186 y=79 width=8 height=16 xoffset=0 yoffset=8 xadvance=10 page=0
char id=124 x=195 y=79 width=4 height=18 xoffset=0 yoffset=8 xadvance=6 page=0
char id=125 x=200 y=79 width=8 height=16 xoffset=0 yoffset=8 xadvance=10 page=0
char id=126 x=209 y=83 width=12 height=6 xoffset=0 yoffset=12 xadvance=14 page=0
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified fonts/fontbuilder_tab_font.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified fonts/fontbuilder_tab_output.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4e1e7f9

Please sign in to comment.