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

Support for DIMCustomSymbols #9116

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Gix3612
Copy link
Contributor

@Gix3612 Gix3612 commented Feb 25, 2023

Coincides with Adding DIMCustomSymbols #441

Revised and cleaned up to properly use data generated with d2-additional-info.

Custom glyphs now generate their own Enums file.

I expanded the Tables list to support more API data and extended Objective functionality to include non-richtext entries so there will be less manualTranslations work.

Marked as draft until I have recreated the font file using a different Private Use Area or a SVG-to-font generator is created, so that users can't start using these before the code points change.

@Gix3612
Copy link
Contributor Author

Gix3612 commented Mar 1, 2023

Okay, so I've recreated the font using the Private Use Plane 15 but have had a few issues trying to make this work.

Firstly, the font converter we are using (@hayes0724/web-font-converter) can convert fonts using the higher PUA-A (U+F0000 - U+FFFFD) but it moves them back into the BMP (U+E000 - U+F8FF) area when it does. So all of our code points generated before the conversion look right but none of the glyphs show up because those aren't the code points being used any more.

After figuring that out, I manually converted the woff2 myself to be sure it did so correctly, disabled the other converter in the code, and inserted mine so that I could continue testing it before seeking help with making the converter work. That's where I am now with my next big issue: the font now displays correctly, but the glyphs aren't being picked up with the hashtags for the filter pills, which defeats the purpose of the custom symbols in the first place if you can't tag anything with them.

Edit: Spoke to soon about the hashtags, fix was easier than expected once I found the relevant files.

If the PUA-A plane can't be made to work, one option could be to start our code points at the end of the BMP area and expand backwards to give the Destiny Keys as much space as possible. There is more than enough room for both sets of glyphs in that range and with the new strand additions it looks like Bungie is finally appending them to the end in a reasonable way so hopefully there wouldn't be any future conflicts.

@Gix3612 Gix3612 marked this pull request as ready for review March 7, 2023 18:43
bhollis added a commit that referenced this pull request Mar 16, 2023
@bhollis
Copy link
Contributor

bhollis commented Mar 16, 2023

Thanks for the updates. I think there are still some concerns about how we keep the font stable as symbols are added/removed, and whether we'd want to shift to more of a Slack/Discord-style :symbol: syntax. It'd be great if you could break out the change to support emoji hashtags into a separate PR so we can merge that first.

@Gix3612
Copy link
Contributor Author

Gix3612 commented Mar 17, 2023

Opened a PR for just the emojis #9254.

@Gix3612
Copy link
Contributor Author

Gix3612 commented Mar 17, 2023

As for Slack-style symbols, from what I can think of, the pros and cons would be:

Slack-style

  • No more codepoints to worry about; easier to update/expand
  • Alternate text for missing images instead of 

Custom Font

  • Woff2 conversion compresses SVGs by ~85%
  • Other sites using the DIM Symbols is similar to using Destiny Symbols; Slack-style would likely require additional api to include them
  • Glyphs are visible in the edit panel
  • Fonts can be recolored

Personally, I like the idea having alt text for the symbols and when editing notes, but, I would prefer it to match Bungie's and use the rich-text replacement system. e.g. [solar] not :solar: Though, this is applicable to either style I think.

@Gix3612 Gix3612 mentioned this pull request Mar 24, 2023
@Gix3612
Copy link
Contributor Author

Gix3612 commented Apr 29, 2023

Not sure if d2-additional-info just rarely gets reviewed or something, but, I've made an update to d2-additional-info#441 awhile ago that includes the font generation from the .SVG files that will automate adding new glyphs while maintaining the codepoints, however, I could still use some feedback and assistance to make sure I am correctly including the new node module it needs in the PR.

@Gix3612 Gix3612 closed this Jun 16, 2023
@Gix3612 Gix3612 force-pushed the DimCustomSymbols branch 2 times, most recently from baf51a1 to f930a75 Compare June 16, 2023 23:43
@Gix3612 Gix3612 reopened this Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants