change font to be more terminal esque

This commit is contained in:
Merith 2025-04-25 17:11:52 -07:00
parent ada0eadd0a
commit 8e7f2f6ab9
6 changed files with 83 additions and 25 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/bin

Binary file not shown.

BIN
datafont.ttf Normal file

Binary file not shown.

62
main.go
View file

@ -15,16 +15,23 @@ import (
"fyne.io/fyne/v2/app" "fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/canvas" "fyne.io/fyne/v2/canvas"
"fyne.io/fyne/v2/container" "fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/theme"
"fyne.io/fyne/v2/widget" "fyne.io/fyne/v2/widget"
) )
// Embed resources
//
//go:embed blessing.txt //go:embed blessing.txt
var blessingBytes []byte var blessingBytes []byte
//go:embed chant.mp3 //go:embed chant.mp3
var chantBytes []byte var chantBytes []byte
//go:embed icon.ico
var iconBytes []byte
//go:embed datafont.ttf
var dataFont []byte
func playChant() { func playChant() {
streamer, format, err := mp3.Decode(io.NopCloser(bytes.NewReader(chantBytes))) streamer, format, err := mp3.Decode(io.NopCloser(bytes.NewReader(chantBytes)))
if err != nil { if err != nil {
@ -41,41 +48,46 @@ func main() {
go playChant() go playChant()
a := app.NewWithID("com.omnissiah.blessing") a := app.NewWithID("com.omnissiah.blessing")
a.Settings().SetTheme(theme.DarkTheme())
w := a.NewWindow("🔧 Rite of Activation")
// Lock resolution // Apply custom font theme
const windowWidth = 400 fontRes := fyne.NewStaticResource("datafont.ttf", dataFont)
const windowHeight = 800 a.Settings().SetTheme(&customTheme{font: fontRes})
w := a.NewWindow("COGITATOR-LINK::RITE-SEQUENCE-ENGAGE")
iconRes := fyne.NewStaticResource("icon.ico", iconBytes)
w.SetIcon(iconRes)
const windowWidth = 480
const windowHeight = 780
w.Resize(fyne.NewSize(windowWidth, windowHeight)) w.Resize(fyne.NewSize(windowWidth, windowHeight))
w.SetFixedSize(true) w.SetFixedSize(true)
// Background // Background black
bg := canvas.NewRectangle(color.RGBA{R: 10, G: 10, B: 10, A: 255}) bg := canvas.NewRectangle(color.RGBA{R: 5, G: 5, B: 5, A: 255})
bg.Resize(fyne.NewSize(windowWidth, windowHeight))
// Header and footer // Header
header := canvas.NewText("+++ ACTIVATE RITE +++", color.RGBA{R: 200, G: 40, B: 40, A: 255}) header := canvas.NewText("+++ INITIATE COGITATOR RITE +++", color.RGBA{R: 100, G: 255, B: 100, A: 255})
header.TextSize = 20 header.TextSize = 18
header.Alignment = fyne.TextAlignCenter header.Alignment = fyne.TextAlignCenter
header.TextStyle = fyne.TextStyle{Bold: true} header.TextStyle = fyne.TextStyle{Monospace: true, Bold: true}
footer := canvas.NewText("<< OMNISSIAH WATCHES >>", color.RGBA{R: 255, G: 200, B: 200, A: 255})
footer.TextSize = 16
footer.Alignment = fyne.TextAlignCenter
footer.TextStyle = fyne.TextStyle{Italic: true}
// Center blessing // Footer
label := widget.NewLabel(blessing) footer := canvas.NewText("<< SYSTEM: BLESSED BY THE OMNISSIAH >>", color.RGBA{R: 255, G: 100, B: 100, A: 255})
label.Alignment = fyne.TextAlignCenter footer.TextSize = 14
footer.Alignment = fyne.TextAlignCenter
footer.TextStyle = fyne.TextStyle{Italic: true, Monospace: true}
// Terminal-style blessing
label := widget.NewLabelWithStyle(blessing, fyne.TextAlignCenter, fyne.TextStyle{Monospace: true})
label.Wrapping = fyne.TextWrapWord label.Wrapping = fyne.TextWrapWord
// Scroll container
scroll := container.NewScroll(label) scroll := container.NewScroll(label)
scroll.SetMinSize(fyne.NewSize(420, 760)) scroll.SetMinSize(fyne.NewSize(windowWidth-20, windowHeight-140))
// Use Border layout to keep footer anchored // Build layout
mainContent := container.NewBorder(header, footer, nil, nil, scroll) content := container.NewBorder(header, footer, nil, nil, scroll)
w.SetContent(container.NewMax(bg, content))
// Final layout with background
w.SetContent(container.NewMax(bg, mainContent))
w.ShowAndRun() w.ShowAndRun()
} }

10
makefile Normal file
View file

@ -0,0 +1,10 @@
default: build compress
build:
@echo "Building the project..."
-mkdir -p ./bin
go build -ldflags="-H windowsgui -s -w" -o ./bin/OmnissiahBlessing.exe
compress:
@echo "Compressing the executable..."
upx --best --lzma ./bin/OmnissiahBlessing.exe

35
theme.go Normal file
View file

@ -0,0 +1,35 @@
package main
import (
"image/color"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/theme"
)
type customTheme struct {
font fyne.Resource
}
func (c *customTheme) Font(style fyne.TextStyle) fyne.Resource {
return c.font
}
func (c *customTheme) Color(name fyne.ThemeColorName, variant fyne.ThemeVariant) color.Color {
return theme.DefaultTheme().Color(name, variant)
}
func (c *customTheme) Size(name fyne.ThemeSizeName) float32 {
switch name {
case theme.SizeNameText:
return 22 // Default is 14; bump it up
case theme.SizeNameHeadingText:
return 24
default:
return theme.DefaultTheme().Size(name)
}
}
func (c *customTheme) Icon(name fyne.ThemeIconName) fyne.Resource {
return theme.DefaultTheme().Icon(name)
}