Skip to content

Switch font - #528

Merged
PringlesGang merged 21 commits into
masterfrom
switch-font
Sep 2, 2026
Merged

Switch font#528
PringlesGang merged 21 commits into
masterfrom
switch-font

Conversation

@PringlesGang

@PringlesGang PringlesGang commented Aug 17, 2026

Copy link
Copy Markdown
Member
  • Adds support for the LCC Switch fonts
  • Add position member to ProcessedTextGlyph
  • Refactor text functions
  • Refactor Label class

A large part of this PR is refactoring text and label functions. The Switch font is the first font type implemented in Impacto that does not have fixed cell dimensions for each glyph in the sprite sheet. A lot of the internal code depended on the position of the glyph to be the top left of its DestRect, which is thus no longer the case, so all these instances had to be fixed.

When testing, make sure all of the labels in all of the menus still behave properly. I had to touch just about all of them.

This PR was not built on top of the Switch assets PR, so to test you'd need to manually edit both fonts.lua files to have the default fonts resemble this:

["Default"] = {
    Type = FontType.EdgeDetectedSingleVariableWidthSheet,
    Sheet = "Font",
    BinaryPath = <FontBinaryAssetPath>,
    BitmapEmWidth = 53,
    BitmapEmHeight = 53,
    DifferenceFactor = 0.8,
    IntensityShift = 0.48,
    AlphaShift = 0.36,
},

with the Font entry in sprites.lua altered accordingly.

@PringlesGang PringlesGang self-assigned this Aug 17, 2026
@PringlesGang
PringlesGang force-pushed the switch-font branch 4 times, most recently from a36dec0 to 069916b Compare August 23, 2026 19:23
@PringlesGang
PringlesGang marked this pull request as ready for review August 23, 2026 20:08
@PringlesGang PringlesGang added game-cclcc CHAOS;CHILD Love Chu☆Chu!! game-chlcc CHAOS;HEAD Love Chu☆Chu! labels Aug 23, 2026
Comment thread src/text/fonts/edgedetectedsinglevariablewidthsheetfont.cpp Outdated
Comment thread src/text/text.cpp
Comment thread src/text/text.cpp Outdated
Comment thread src/text/text.cpp Outdated
Comment thread src/ui/widgets/label.cpp Outdated
void Label::SetText(Vm::Sc3Stream& stream, float fontSize,
RendererOutlineMode outlineMode,
template <typename T>
void Label::SetText(T str, float fontSize, RendererOutlineMode outlineMode,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use the concept or extend it if needed

Comment thread src/ui/widgets/chlcc/saveentrybutton.cpp
Comment thread src/ui/widgets/label.h Outdated
@PringlesGang
PringlesGang merged commit 867ef85 into master Sep 2, 2026
9 checks passed
@PringlesGang
PringlesGang deleted the switch-font branch September 2, 2026 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

game-cclcc CHAOS;CHILD Love Chu☆Chu!! game-chlcc CHAOS;HEAD Love Chu☆Chu!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants