Mark2Mark / variable-font-preview

https://markfromberg.com/projects/variable-font-preview-3/
8 stars 0 forks source link

Preview option for only displaying glyphs on selected line #17

Closed gorjious closed 1 year ago

gorjious commented 2 years ago

I often have a long list of contextual alternates sets in a tab. When I use VFP to check, the preview becomes far too long and slow so I have to resort to opening a new tab, copying/pasting the glyphs, turning on the features, and turning VFP off/on, reset params.

I see there is an open issue for centering on the selection, however, my tangential suggestion would be to (by default or have the option to) isolate the preview to only the glyphs on a specific line. I imagine this would improve performance, as only a select amount of glyphs are being previewed at a time.

I have made a similar suggestion for the default glyphs preview . Perhaps if there is an implementation in a plugin, this can help promote it to the main editor.

I have made an attempt at a general preview plugin with the isolate line view. (I'd be happy to share my messy code)

Mark2Mark commented 2 years ago

Thank you.

That line isolation is actually a good idea. If your have some sample, no matter which language, that would be very helpful to speed up the implementation. Don't worry about messy code.

Much appreciated :)

gorjious commented 2 years ago

Here is the wip plugin: SoloPanel WIP.zip

It uses Rotate View plugin as the starting point so if you have that installed it might conflict and in the Window menu it will appear as Rotate View.

Obvious issues: When there is a single glyph, it doesn't show up in the preview (2 or more works).

I think the text in the window should always be centered vertically. I was having trouble figuring out how to change the font size using the font size slider at the bottom and still keep everything centered.

Not sure if I accounted for all the transformation. I think I got how kerning shifts from Toshi's waterfall plugin. Also, not sure if it accounts for calts and other features. Or how it works with RTF scripts.

Some things I like: Resizing the window rescales the text so the font size slider is more relative to the window which I think it keeps things more compact. The window size can get really short vertically which makes arranging windows on smaller screens easier.

Some things I wish: Left, Center, Right alignment. In general, when left-aligned (or right) it's nice that there is always some fixed point of reference. Center would be useful too.

Before reaching a technical dead-end (due to n00b coding skills) I also was thinking to add an invert text color button.

Hope this helps:-)

Mark2Mark commented 1 year ago

Should be fixed with b974f37, that version is live since about a week now.

Used my own algorithm, didn’t have a look at your plugin. So if it behaves differently, that is why. But it effectively shows only the current line, which is what you asked for with "Preview option for only displaying glyphs on selected line" and I also wanted to add since a while :)

Otherwise if there where other sub-issues or wishes I overlooked, please open a new issue for each. Please be as granular as possible, as mixing different issues is hard to manage.

Thanks for your input! Much appreciated. @gorjious

gorjious commented 1 year ago

I am noticing that when the preview window is in the Edit View, the current line is working, however, when Separate Window mode, it shows all the lines.

Screenshot 2023-05-21 at 1 13 06 PM Screenshot 2023-05-21 at 1 13 24 PM
Mark2Mark commented 1 year ago

Thanks for catching this!

Will fix it in a moment.

Mark2Mark commented 1 year ago

Closed with 3fb4595