Aedif / tactical-grid

GNU General Public License v3.0
5 stars 4 forks source link

[Feature Request] Grid-independent Distance Label Size #15

Closed LukasPrism closed 11 months ago

LukasPrism commented 11 months ago

Would it be possible to unshackle the distance label font size from the scene grid? We use scenes from multiple sources, and as you can see when we jump from scene to scene the font size on the tokens varies wildly:

A House Divided – 200px grid size

Screenshot 2023-08-21 at 2 53 32 PM

Forgotten Adventures – 100px grid size

Screenshot 2023-08-21 at 2 53 54 PM

Many thanks!

LukasPrism commented 11 months ago

Actually I just noticed that drag ruler and the nameplate sizes also change based on grid pixel density. I wonder if there would be a blanket way to fix all of these 🤔

Let me know what you think – I'll close the issue if you don't think it's relevant to Tactical Grid. I guess it's just more obvious with the distances on the tokens.

Aedif commented 11 months ago

There is nothing to be "fixed" per say. If you look at the CONFIG.canvasTextStyle you'll find the default style used by all the pieces of text on the canvas. Some text has hard coded conditions such as this:

  /**
   * Get the text style that should be used for this Token's tooltip.
   * @returns {string}
   * @protected
   */
  _getTextStyle() {
    const style = CONFIG.canvasTextStyle.clone();
    style.fontSize = 24;
    if (canvas.dimensions.size >= 200) style.fontSize = 28;
    else if (canvas.dimensions.size < 50) style.fontSize = 20;
    style.wordWrapWidth = this.w * 2.5;
    return style;
  }

that modify the font size based on canvas dimensions in discrete steps.

It seems very much intentional. I can perhaps add some sort of font size scaling option for Tactical Grid measurements but messing with all the numerous contexts that text appears in Foundry is far beyond this module.

LukasPrism commented 11 months ago

Hmm yeah I’ll close the issue, it is bigger than this module. I do find it very odd that text size is based on grid pixel density and not just the grid size itself. It means the text isn’t consistent with token size from scene to scene. Token/grid size seems like a much more obvious visual benchmark than something that is invisible to the viewer like number of pixels per grid.

Aedif commented 11 months ago

https://github.com/Aedif/tactical-grid/releases/tag/1.15.0