Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use monospaced digits font feature for chapter list in "Chapters" menu item #2424

Closed
YourMJK opened this issue Apr 16, 2019 · 3 comments

Comments

3 participants
@YourMJK
Copy link

commented Apr 16, 2019

System and IINA version:

  • macOS 10.14.4
  • IINA 1.0.3 Build 106

Feature Request / "OCD-breaking bug":

IINA should use the monospaced digits feature of the system font in the "Chapters" menu item which lists the chapters' timestamps along with their name.
This way the timestamps and names would all be nicely horizontally aligned (in columns) and therefore easier and more pleasant to read.

I think this can be achieved by setting the NSMenuItem's attributedTitle to a NSAttributeString which has the specific font as an attribute.
The font could be obtained by calling NSFont.menuFont(ofSize: 0) (to get the default menu font at it's default size) and adding the monospaced numbers feature in the font descriptor.

It would also be nice if as a separator between timestamp and chapter name, an en-dash ("–", U+2013) or even an em-dash ("—", U+2014) would be used, instead of a normal hyphen ("-") like it's currently.

Currently it looks like this:
current screenshot
As you can see, the chapter names here are not nicely aligned in a column, just like the timestamp components and the separators aren't.

@YourMJK YourMJK changed the title Use monospaced digits font for chapter list in "Chapters" menu item Use monospaced digits font feature for chapter list in "Chapters" menu item Apr 16, 2019

@anohren

This comment has been minimized.

Copy link
Contributor

commented Apr 18, 2019

How about also padding all timestamps with zeros to the same length as the last timestamp? Then the titles would line up as well

@saagarjha

This comment has been minimized.

Copy link
Member

commented May 29, 2019

Screen Shot 2019-05-29 at 05 46 49

Interestingly, using the font descriptor doesn't seem to work with whatever font `NSFont.menuFont(ofSize:)` returns, so I substituted `NSFont.monospacedDigitSystemFont(ofSize:weight:)`.

@saagarjha saagarjha closed this in 818b436 May 29, 2019

@YourMJK

This comment has been minimized.

Copy link
Author

commented May 29, 2019

Perfect! Thank you very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.