-
Notifications
You must be signed in to change notification settings - Fork 327
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
Add D100 Support for DiceFont #3463
base: master
Are you sure you want to change the base?
Add D100 Support for DiceFont #3463
Conversation
Hi @IndentYourCode ! Thanks for your contribution. I just want to be sure with @5e-Cleric , but if I read the original issue correctly, I think the desire is to add actual additional icons to the font, containing the double-digit numbers, rather than displaying two d10's side by side. Is that right? |
Ahh I could see that. I'm not sure how I'd go about editing a font to achieve this. But I'm interested in giving it a shot! I'll hang back and wait for next steps 🫡 |
The original issue was that, but we could do two dice, after all when we roll a d100 on the table, we use two dice. I'd say we do this either way, but if we go with two dice, we could go further into the real world, and have the dice look like they would do, with two numbers on one and one on the other: (00-90)(0-9) I don't have any strong opinion on this, it's just an idea, perhaps @G-Ambatte has something to say, he brought the font in the first place. |
Any idea how that would be implemented? Would I need to go make custom .svg's for the font if that's the case? I could probably do that. The dice might be cluttered with two digits on one d10, but I suppose that could just be fixed by having the user increase font size. Either way, I'm happy to contribute! |
@Gazook89 has some recent experience adding icons to icon fonts. Perhaps he can give you some basic steps. I believe https://icomoon.io/app is a good tool for converting between svg and font, and Inkscape is a good free svg editor. |
I don't like being able to set any number. That's too obtuse and finnicky, and is not truly an icon. There are already plenty of dice with two digits, such as d10's and d20s. Granted, the Is there any use of these types of dice fonts in source material (DND books, or really any TTRPG resource)? As @5e-Cleric mentioned, I would expect two dice, but with one being the 10's and the other being 1's-- or said in another way, the 00-90 and the other 0-9. Regarding the 'process', I could probably make the font glyphs or someone else can do them...but here is the rough idea:
|
This is great! I'll take a look tonight and tomorrow and see what I can do if that's okay? I think I'd like to try out editing the svg as well. |
With all of this, keep in mind we just merged the emoji syntax
is probably not going to interact cleanly with that.
It is pretty common to reference a "d100". This generally means roll 2 d10s, but the accompanying table of results will show a range of say That specific example aside, there are real d10's with a 0 at the end, so ranging from 0 (or 00) to 90 as @5e-Cleric mentions. If we are going to add those, might as well just add all the numbers in between while we're making the effort. Compared to something like FontAwesome, another 90 icons isn't really a lot. |
funny, a kagi search of 'd10 svg' returned this game-icons.net github discussion: |
Saw a version with three digits up there why would we do that? we only would need 00-99 in one die, or 00-90 + 0-9, i don't care between the two, but apart from reaching a decision this looks like fruitless. No need for erasing strokes or fancy stuff. Lets do 00-99 (remember 00 is 100 in a d100) |
Right. @IndentYourCode If you want to keep working on this, just go ahead and add the double-digit numbers (00-99) to the icon font using the same original style to keep it simple. Sorry we bombarded your first PR with lots of side discussion. Everyone else, let's pause the discussion here unless it directly ties to IndentYourCode's progress, and move talks about fancier dice out to a separate issue. |
Haha y'all are good! It should be kinda expected that a PR for a minor thing on a project with a bunch of D&D and software nerds would result in a multi-discussion chain about the all the best/possible/optimal ways to represent a D100. I guess a follow up for @5e-Cleric and @Gazook89 would be about Less? In the original issue it was suggested to use a loop to generate these? But it's sound like since we're modifying the font itself, I'd need to at least go through and create 100 unique svgs for the fonts. Is there a quicker way to do this that I'm not connecting? I think that's why I went about my way to begin with. |
uh.. the appropiate way to go is to create an svg for every number with the die, then compile them into a font, ideally, the DiceFont, using a font maker tool like https://www.glyphrstudio.com/app/ loading the font in otf or ttf, and copying glyphs. BUT, i can offer another option, way less time consuming:
|
G-Ambatte already suggested a dynamic solution like this above. I think we need to just stick to adding the new images to the font. Maybe more initial effort, but much more straightforward result. Keep consistent with all the other numbered dice in this font. |
Do you still plan on working on this PR? I might move this off the review queue if it needs to simmer for a while. |
Sorry, you're good to do whatever. I ended up having a busy summer and now I'm working full time. Probably won't be able to do this in a timely manner. Do with it whatever you see fit! |
In response to issue #3347.
Hey all, this is my first time contributing to open source. Please let me know if there's ways to improve this. This was also my first time using Less, but I think I was able to get this functionality working as intended.
New CSS class names are supported using the "df d100-##" format. As such, they the "##" will be parsed as if it were a number 0-99. The numbers will be parsed, and then use the diceFont fonts to display two d-10s with the corresponding percentile dice result.
Let me know if there's anything else that should be changed.
Here are some examples: