@@ -22,6 +22,9 @@ const (
2222 warnSymbolShift = 8.0
2323 textWidthRatio = 0.45
2424 textHeightRatio = 1.0
25+
26+ // Font stack: Patrick Hand (Google Fonts), then common casual/handwriting fonts
27+ fontFamily = `'Patrick Hand', 'Comic Sans MS', 'Bradley Hand', 'Segoe Script', sans-serif`
2528)
2629
2730type HandDrawn struct { seed uint64 }
@@ -87,11 +90,11 @@ func (h *HandDrawn) RenderText(buf *bytes.Buffer, b styles.Block) {
8790 b .CX - textW / 2 , b .CY - textH / 2 , textW , textH , grey )
8891
8992 if rotate {
90- fmt .Fprintf (buf , ` <text x="%.2f" y="%.2f" text-anchor="middle" dominant-baseline="middle" font-family="'Patrick Hand', cursive " font-size="%.1f" fill="#333" transform="rotate(-90 %.2f %.2f)">%s</text>` + "\n " ,
91- b .CX , b .CY , size , b .CX , b .CY , styles .EscapeXML (b .ID ))
93+ fmt .Fprintf (buf , ` <text x="%.2f" y="%.2f" text-anchor="middle" dominant-baseline="middle" font-family="%s " font-size="%.1f" fill="#333" transform="rotate(-90 %.2f %.2f)">%s</text>` + "\n " ,
94+ b .CX , b .CY , fontFamily , size , b .CX , b .CY , styles .EscapeXML (b .ID ))
9295 } else {
93- fmt .Fprintf (buf , ` <text x="%.2f" y="%.2f" text-anchor="middle" dominant-baseline="middle" font-family="'Patrick Hand', cursive " font-size="%.1f" fill="#333">%s</text>` + "\n " ,
94- b .CX , b .CY , size , styles .EscapeXML (b .ID ))
96+ fmt .Fprintf (buf , ` <text x="%.2f" y="%.2f" text-anchor="middle" dominant-baseline="middle" font-family="%s " font-size="%.1f" fill="#333">%s</text>` + "\n " ,
97+ b .CX , b .CY , fontFamily , size , styles .EscapeXML (b .ID ))
9598 }
9699 })
97100 buf .WriteString (" </g>\n " )
@@ -125,8 +128,8 @@ func (h *HandDrawn) RenderPopup(buf *bytes.Buffer, b styles.Block) {
125128
126129 textY := popupTextStartY
127130 for _ , line := range descLines {
128- fmt .Fprintf (buf , ` <text x="%.1f" y="%.1f" font-family="'Patrick Hand', cursive " font-size="%.0f" fill="#444">%s</text>` + "\n " ,
129- popupTextX , textY , popupTextSize , styles .EscapeXML (line ))
131+ fmt .Fprintf (buf , ` <text x="%.1f" y="%.1f" font-family="%s " font-size="%.0f" fill="#444">%s</text>` + "\n " ,
132+ popupTextX , textY , fontFamily , popupTextSize , styles .EscapeXML (line ))
130133 textY += popupLineHeight
131134 }
132135
@@ -144,19 +147,19 @@ func (h *HandDrawn) RenderPopup(buf *bytes.Buffer, b styles.Block) {
144147 }
145148
146149 if p .LastCommit != "" {
147- fmt .Fprintf (buf , ` <text x="%.1f" y="%.1f" text-anchor="middle" font-family="'Patrick Hand', cursive " font-size="%.0f" fill="#444">%slast commit: %s</text>` + "\n " ,
148- dateX , rightY , popupTextSize , warnPrefix , p .LastCommit )
150+ fmt .Fprintf (buf , ` <text x="%.1f" y="%.1f" text-anchor="middle" font-family="%s " font-size="%.0f" fill="#444">%slast commit: %s</text>` + "\n " ,
151+ dateX , rightY , fontFamily , popupTextSize , warnPrefix , p .LastCommit )
149152 rightY += popupLineHeight * dateLineSpacing
150153 }
151154 if p .LastRelease != "" && p .LastRelease != "0001-01-01" {
152- fmt .Fprintf (buf , ` <text x="%.1f" y="%.1f" text-anchor="middle" font-family="'Patrick Hand', cursive " font-size="%.0f" fill="#444">%slast release: %s</text>` + "\n " ,
153- dateX , rightY , popupTextSize , warnPrefix , p .LastRelease )
155+ fmt .Fprintf (buf , ` <text x="%.1f" y="%.1f" text-anchor="middle" font-family="%s " font-size="%.0f" fill="#444">%slast release: %s</text>` + "\n " ,
156+ dateX , rightY , fontFamily , popupTextSize , warnPrefix , p .LastRelease )
154157 }
155158
156159 if p .Stars > 0 {
157160 starsCenterY := statsStartY + (popupLineHeight * float64 (statsRows ))/ 2 - popupStarShift
158- fmt .Fprintf (buf , ` <text x="%.1f" y="%.1f" text-anchor="middle" dominant-baseline="middle" font-family="'Patrick Hand', cursive " font-size="%.0f" fill="#222" font-weight="bold">★ %s</text>` + "\n " ,
159- leftCenterX , starsCenterY , popupStarSize , formatNumber (p .Stars ))
161+ fmt .Fprintf (buf , ` <text x="%.1f" y="%.1f" text-anchor="middle" dominant-baseline="middle" font-family="%s " font-size="%.0f" fill="#222" font-weight="bold">★ %s</text>` + "\n " ,
162+ leftCenterX , starsCenterY , fontFamily , popupStarSize , formatNumber (p .Stars ))
160163 }
161164 }
162165
0 commit comments