Grid Sage Forums

Grid Sage Forums

  • November 21, 2024, 11:00:02 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

LINKS: Website | Steam | Wiki

Author Topic: Mirroring Glyphs  (Read 4275 times)

sageleaf

  • Unaware
  • *
  • Posts: 1
    • View Profile
Mirroring Glyphs
« on: August 10, 2020, 06:14:02 AM »

Is their anyway to link more Glyphs as mirrors of one another? Much like rexpaint with the default font can correctly flip the '\' into '/' when pasting when flipping along the y axis.
Logged

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4477
    • View Profile
    • Cogmind
Re: Mirroring Glyphs
« Reply #1 on: August 10, 2020, 11:57:11 PM »

Hi sageleaf, not currently, nope. It's something that was brought up shortly before release of 1.50 so I didn't have time to work that in, but it's on my list for the future.

Also it's the kind of thing I might want to wait until the 2.0 UI before tackling, but I dunno, if there's enough demand and I can come up with an acceptable solution I might do it earlier...

Seems like the quickest way to add such a feature ends up being not so user-friendly by probably requiring an external text file that simply lists additional flippable glyph index pairs.
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

gumix

  • Cyborg
  • ***
  • Posts: 134
    • View Profile
Re: Mirroring Glyphs
« Reply #2 on: August 18, 2020, 10:29:47 AM »

Quote
external text file
I bet this is the most user friendly way.
I'm also hoping this feature will be included in RP some time.
Logged

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4477
    • View Profile
    • Cogmind
Re: Mirroring Glyphs
« Reply #3 on: August 18, 2020, 03:06:33 PM »

Ah there you are, gumix ;)

Yeah I made note of it when you first brought it up, and it's been at the top of the REXPaint priority list. Probably the kind of thing I should've already put in this release together with the other features, though I decided that for now I wanted to wait to see what the 1.50 reception was like first, since I wasn't yet completely sure about the best way to implement it anyway, and maybe there'd be some other things to include in a new update.

Looking at how things are progressing now, and the demand, I'll probably add this as a patch here on the forums before too long...

Musing on how this would work, it seems like this feature almost certainly needs to have mirroring behavior be associated with specific fonts, eh? In that case, it might make sense to specify external files on a per-font basis directly in data/fonts/_config.xt via a new column. Also I guess the default mirroring behavior that we already have would be reflected in an external file as well, just to fit into the system and also serve as an example.
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

gumix

  • Cyborg
  • ***
  • Posts: 134
    • View Profile
Re: Mirroring Glyphs
« Reply #4 on: August 18, 2020, 05:05:50 PM »

Sounds really good!
I couldn't imagine anything better. So I can have one ie: 'cp437-mirror.txt' file for all font sizes :) I guess petscii users are going to appreciate this functionality even more, there are a lot more symmetrical glyphs.
Thanks so much!
Logged

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4477
    • View Profile
    • Cogmind
Re: Mirroring Glyphs
« Reply #5 on: August 18, 2020, 07:49:03 PM »

Quite true, having played with the PETSCII set before I can see how this would be useful even within the 256-character limit!
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon

Kyzrati

  • Administrator
  • True Cogmind
  • *****
  • Posts: 4477
    • View Profile
    • Cogmind
Re: Mirroring Glyphs
« Reply #6 on: September 24, 2020, 02:56:51 AM »

sageleaf and gumix! I have something for you...

Coming to the next release of REXPaint is... you guessed it, customizable glyph mirroring!

It's already available now as a patch if you'd like access to it (or give any feedback) before the official release. You can download the preview patch here(edit: patch removed since this is now included in 1.60), which includes only files that are new/modified from v1.50.

With this version you can assign glyph pairs on a per-font basis by specifying a file where those values can be found. Notice that the font _config.xt also includes two new columns to make new features possible. (This same patch also includes support for customizing Unicode code points, as well as a few other QoL features.)

The updated manual should have the necessary details:
Quote
...

Notice in _config.xt that each art font also includes two additional parameters: Unicode and Mirror. These specify two text files, also expected to be found in the "data/fonts/" directory, which define code points for UTF8 text exporting and glyph mirroring behavior for the paste tool, respectively. The default files provided are compatible with a standard CP437 layout. If neither of those features is required for a given font, using the default files is fine, or even just insert a single hypen ('-') for a filename there and it will be ignored. See the sections below for more information on customizing these features.

...

 Custom Glyph Mirroring
------------------------
While the Paste tool's alternate mode can mirror CP437 glyphs, with custom fonts using some other layout it is often desirable to specify different sets of glyph pairs for this purpose. You can do this by creating a new text file in the "data/fonts/" directory that defines pairs and assign it to its respective font in _confit.xt via the Mirror column. See the default CP437 _mirror.txt file for an example of the required layout. Each line should specify a single pair, and indicate whether the mirroring direction is horizontal (h) or vertical (v).  Indices start from 0 and proceed in row-major order, as displayed in the font bitmap. Add optional comments at the end of a line by preceding them with two slashes.

Here's a demo showing some custom mirroring with an extended tileset:



Let me know how it works out.
« Last Edit: October 10, 2020, 05:21:04 PM by Kyzrati »
Logged
Josh Ge, Developer - Dev Blog | @GridSageGames | Patreon