javalent / fantasy-statblocks

Create Dungeons and Dragons style statblocks for Obsidian.md
MIT License
356 stars 69 forks source link

🐞 Ability score of 0 doesn't display #449

Open scooper4711 opened 2 months ago

scooper4711 commented 2 months ago

Check for existing bug reports before submitting.

Expected Behavior

Ability mods should always be displayed, even when zero

Current behaviour

an abilityMods of

abilityMods: [1,0,0,0,0,1]

shows that the zeros are not rendered.

image

Reproduction

Use the yet unreleased version of fantasy statblocks post 4.6.0 specify an abilityMod that includes zeros.

Which Operating Systems are you using?

Obsidian Version Check

1.6.7 and 1.6.5

Plugin Version

unreleased

Confirmation

Possible solution

revert commit 4de2457cdd8b2a91fb99e8a794b489e297ca9ccf

I've tested, and it looks like this fixes the issue. Not sure what causes it. But the commit message looks pertinent to the issue and I reverted it to test. That solved the issue.

scooper4711 commented 2 months ago

I'm seeing the same behavior for hitpoints. It appears that the font used doesn't include the number zero.

dylbrown commented 1 month ago

Hm, this is a very odd bug. I'll see if I can get my hands on a Mac to reproduce this, it doesn't appear on Windows or iPhone/iPad. At a guess the unicode-range isn't working as expected? It should only be loading certain characters from the font.

scooper4711 commented 2 weeks ago

Just to let you know that this is appearing everywhere in the fantasy statblock. Ability scores, range increments, movement. Everything. Zeros just don't display.

dylbrown commented 2 weeks ago

Ah, thanks! Sorry, I lost track of looking into this, but I've just managed to get access to a Mac, I'll have it in hand Saturday. I'll take a look then! Hopefully should have a fix up as well.

scooper4711 commented 1 week ago

I have more info now - it looks like it's an issue with Fantasy Statblocks, but only when inside of the Initiative Tracker window for the selected combatant. Here's a screenshot of the issue. The left pane is the note itself opened via Cmd-O. The right pane is the creature when rendered by clicking on it in the active combat.

Screenshot 2024-10-21 at 3 06 56 PM
scooper4711 commented 1 week ago

Looks like for HP in the initiative tracker, font-family is set to: var(--active-traits-font) but that var is not defined. While in the main view, the font-family is defined as 'GoodOT-WideLight', 'Merriweather Sans', var(--font-default), sans-serif (not using a var).

dylbrown commented 1 week ago

Just to check before I poke into this (getting myself onto a mac has proved difficult but there's still hope), which version of the Pathfinder sourcing/templating are you using: the pre-remaster or remaster? Want to remove as many variables as possible

scooper4711 commented 1 week ago

I assume you're talking about Style Settings, where I can choose between those two options? Confirmed this is an issue in both.

I'm happy to do a remote debug session over discord.

dylbrown commented 1 week ago

Sure, if you're up for that I'd be glad to! Would simplify some things.

scooper4711 commented 1 week ago

@coop4711 on discord

scooper4711 commented 1 week ago

I FOUND IT!

It's the plugin "Pathfinder 2E Action Icons" I always include it, because the bestiary exports use it. But it seems to be the culprit. Looking more...

scooper4711 commented 1 week ago

So, without the plugin enabled, the lines in question are triggering the CSS rule: .pf2e .statblock p:not(.statblock-item-inline p) { which specifies this font family: font-family: 'GoodOT-WideLight', 'Merriweather Sans', var(--font-default), sans-serif;

with the plugin enabled, the lines in question are triggering the CSS rule: .trait.svelte-1d2gp4n { with this font family font-family: var(--active-traits-font);

dylbrown commented 1 week ago

Will be fixed by thiagocoutinhor/pf2-action-icons#7