View Issue Details

IDProjectCategoryView StatusLast Update
0001623OpenMPTUser Interfacepublic2022-08-14 14:14
Reportercs127 Assigned To 
PrioritylowSeverityfeatureReproducibilityalways
Status newResolutionopen 
Platformx86 / x64OSAny 
Product VersionOpenMPT 1.31.00.* (current testing) 
Summary0001623: [Feature request] FontDot for built-in fonts
Description

I have set the Pattern Editor.FontDot option to a space instead of a dot, and it looks great when using a custom font,
but sometimes I need to set the font to "Built-in (small)" when I want to have more channels visible on screen (normally I use the "Terminal" font of Windows, whose size can't be smaller than 9), and the FontDot option doesn't affect built-in fonts.

I know it's not possible to support every character (because the font bitmap only has the few characters necessary to draw notes, numbers, and commands letters), but it would be nice to still be able to set the FontDot for the characters that are in the bitmap, like how the same thing is done for custom note names in tunings.

Steps To Reproduce
  1. Set the Pattern Editor.FontDot character to anything other than a dot.
  2. Set the font to one of OpenMPT's built-in fonts.
  3. The empty spaces still appear as dots instead of the character that was set.
TagsNo tags attached.
Has the bug occurred in previous versions?Yes
Tested code revision (in case you know it)17715

Relationships

related to 0001114 new Rewrite pattern view drawing 

Activities

Saga Musix

Saga Musix

2022-08-12 19:24

administrator   ~0005265

There's quite a few reasons why this cannot really work:

  • Pattern Editor.FontDot requires a user-chosen font to begin with, which is not available when using a custom font
  • Even if there was a user-chosen font, we wouldn't know at which size to render it. There is absolutely no guarantee about the effective size of a character even if we say that we want e.g. a 10pt font.
  • The built-in fonts use a manually fine-tuned display grid, which makes it very difficult to sensibly integrate any sort of unknown font into

As a consequence, I cannot see how to implement this in a way which doesn't need to introduce at a handful of new settings or so (font, font size, cutout offset for the character, target position for the character). This is not feasible for such a small feature.

cs127

cs127

2022-08-12 21:11

reporter   ~0005267

Pattern Editor.FontDot requires a user-chosen font to begin with, which is not available when using a custom font

"not available by using a custom font"? I don't really understand what you mean by that.

when I said "custom font" I was referring to a user-chosen font, like a TrueType font, as opposed to the built-in font.

The built-in fonts use a manually fine-tuned display grid, which makes it very difficult to sensibly integrate any sort of unknown font into

again, I don't know what you mean by "integrating unknown fonts"

What I meant is to have the FontDot option not only affect user-chosen fonts, but also the built-in fonts.

Basically, all I want is that when I set the FontDot option to an empty space character, I want the dots in the pattern editor to be shown as empty spaces, not only when using fonts installed on Windows/Wine (e.g. TrueType fonts), but also OpenMPT's built-in fonts. And if the FontDot is set to characters that aren't supported by the built-in fonts, like ! and $, just render them as an empty space, like custom note names in tunings.

Let me know if I misunderstood anything.

Saga Musix

Saga Musix

2022-08-12 21:20

administrator   ~0005268

"not available by using a custom font"? I don't really understand what you mean by that.

What I mean is that there is no custom font configuration available when using default pattern fonts. A new UI workflow for being able to pick a font for this single letter would have to be implemented.

again, I don't know what you mean by "integrating unknown fonts"

As said, everything about the built-in fonts is manually crafted, which allows them to take up less space. For example there is no space available below the baseline (cf. https://upload.wikimedia.org/wikipedia/commons/3/39/Typography_Line_Terms.svg) because our font essentially just consists of uppercase letters and digits. This makes it pretty much impossible to merge any font with unknown proportions into the same bitmap without looking completely out-of-place, unless of course we give the user the option to manually specify a cutout area from where to copy the character and where to paste it into in our bitmap, which would be a completely overblown solution to this problem. The only really viable soltution is custom bitmap fonts that can be provided by the user.

cs127

cs127

2022-08-13 02:17

reporter   ~0005269

This makes it pretty much impossible to merge any font with unknown proportions into the same bitmap without looking completely out-of-place

I never said anything about merging fonts. I really don't know if I'm not understanding what you're talking about, or if you misunderstood the point of this feature request.

I just want the Pattern Editor.FontDot option to affect Built-in fonts like Built-in (small) and Built-in (large), instead of only affecting custom user-chosen fonts like Terminal or GNU Unifont or whatever fonts are installed on the operating system.

For characters that aren't in the built-in font, just don't draw them, like how characters like $ are not drawn if they are in a custom note name of a custom tuning.

If that's not easy to implement, it's fine. I just want to make sure that you understand what I'm talking about. Thanks for your quick responses btw.

cs127

cs127

2022-08-13 10:57

reporter   ~0005270

Well, nevermind. After looking at the source code, I think I can see why it might be hard to implement for the built-in fonts.

I'll keep this feature request open, in case you ever want to implement this at some point in the future.

Saga Musix

Saga Musix

2022-08-13 12:36

administrator   ~0005271

Thanks for clarifying again. Then essentially what you are asking for is an extremely narrow special case of FontDot, because you want the dots to disappear. Solving that in another way would make a lot more sense, because of all the built-in font characters, space is about the only one that would make sense to be used.

Saga Musix

Saga Musix

2022-08-13 15:36

administrator   ~0005272

What I could imagine is having different sets of preset images to fill the pattern with:

  • Dots, like at the moment
  • Zeros, like in ProTracker/FT2
  • Empty space

This could be achieved much more easily than adjusting the FontDot option in any way for the built-in fonts.

cs127

cs127

2022-08-14 11:19

reporter   ~0005273

Sure, that's a nice idea.

I like the idea of zeros, but it doesn't make sense to have zeros in the note column.

So maybe the presets could be better like this:

  • Dots
  • Empty space
  • Zeros (dots for note column)
  • Zeros (empty space for note column)

it would also be nice to have those zeros options for custom fonts as well. Maybe by having two separate FontDots, one for the note column, and the other for the rest of the columns. Maybe even four, each one for a different column.

manx

manx

2022-08-14 14:14

administrator   ~0005279

Uhm, I think we can use the existing FontDot setting even for builtin fonts:
We need to interpret at the point of blitting from the font bitmap instead of when constructing the font bitmap (which does not happen for unscaled builtin fonts). We might need to additionally track if the mapping has already been performed (when constructing the bitmap), as I currently do not know whether we do that already anyway for other reasons.

Issue History

Date Modified Username Field Change
2022-08-12 17:02 cs127 New Issue
2022-08-12 19:24 Saga Musix Note Added: 0005265
2022-08-12 21:11 cs127 Note Added: 0005267
2022-08-12 21:20 Saga Musix Note Added: 0005268
2022-08-13 02:17 cs127 Note Added: 0005269
2022-08-13 10:57 cs127 Note Added: 0005270
2022-08-13 12:36 Saga Musix Note Added: 0005271
2022-08-13 15:36 Saga Musix Note Added: 0005272
2022-08-14 11:19 cs127 Note Added: 0005273
2022-08-14 14:14 manx Note Added: 0005279
2022-08-14 14:14 manx Relationship added related to 0001114