font support #488

Closed
opened 2021-09-05 10:03:42 +02:00 by JustinSDK · 7 comments
JustinSDK commented 2021-09-05 10:03:42 +02:00 (Migrated from github.com)

I publish a Emoticon moai.
https://cadhub.xyz/u/caterpillar/emoticon-moai

It requires the font parameter of text to vary emoticons. It seems that Cadhub doesn't support the parameter. The font support might be scheduled on the further version. :)

I publish a Emoticon moai. https://cadhub.xyz/u/caterpillar/emoticon-moai It requires the `font` parameter of `text` to vary emoticons. It seems that Cadhub doesn't support the parameter. The `font` support might be scheduled on the further version. :)
Irev-Dev commented 2021-09-05 13:19:49 +02:00 (Migrated from github.com)

Hey, sounds good.
Here's another relevant discussion: https://github.com/Irev-Dev/cadhub/discussions/464#discussioncomment-1216768

As @t-paul mention, it wouldn't be hard to give a list of available fonts (in the ubuntu container it's running on), the problem is more of how does the script author indicate that they want a font select UI? Is this supported elsewhere?

Hey, sounds good. Here's another relevant discussion: https://github.com/Irev-Dev/cadhub/discussions/464#discussioncomment-1216768 As @t-paul mention, it wouldn't be hard to give a list of available fonts (in the ubuntu container it's running on), the problem is more of how does the script author indicate that they want a font select UI? Is this supported elsewhere?
t-paul commented 2021-09-05 22:26:01 +02:00 (Migrated from github.com)

I've not seen dedicated customizer support for fonts, they just declared this in a pinned post in the thingiverse group:

Also, all the google fonts from http://www.google.com/fonts have been added to the servers and can be used in text() :)
https://www.thingiverse.com/groups/openscad/forums/general/topic:1813

There might be a reasonable extension to the customizer markup for declaring an input field shall be a font selector.

I've not seen dedicated customizer support for fonts, they just declared this in a pinned post in the thingiverse group: > Also, all the google fonts from http://www.google.com/fonts have been added to the servers and can be used in text() :) > https://www.thingiverse.com/groups/openscad/forums/general/topic:1813 There might be a reasonable extension to the customizer markup for declaring an input field shall be a font selector.
Irev-Dev commented 2021-09-05 23:52:51 +02:00 (Migrated from github.com)

@JustinSDK In the mean time I've documented the list of available fonts here: https://learn.cadhub.xyz/docs/general-cadhub/openscad-fonts
and made a Cadhub project demoing them here: https://cadhub.xyz/u/irevdev/all-scad-fonts
If that's useful you could link to either of those in your projects that use text.
Alternatively, since we support selects, if there's a few fonts that you think are good you could curate them yourself and put them into a select?

// font select for left eye
font_l_eye = "Arial Black"; // ["DejaVu Serif","Arial Black", "URW Gothic L"]

image

@t-paul I should be able to work with what ever is decided if that's something you want to add. Since the format for string params is already

{
      "caption": "Text box for string with length 8",
      "group": "Parameters",
      "initial": "length",
      "maxLength": 8,
      "name": "stringMaxLength",
      "type": "string"
}

You could keep the type as string since that's what it is fundamentally and add input: "font" or font-select in? That way it's backwards compatible, just defaults back to a regular string input if the select isn't supported?

Don't know what the syntax might be? // [::font-select] 🤷 ?

@JustinSDK In the mean time I've documented the list of available fonts here: https://learn.cadhub.xyz/docs/general-cadhub/openscad-fonts and made a Cadhub project demoing them here: https://cadhub.xyz/u/irevdev/all-scad-fonts If that's useful you could link to either of those in your projects that use text. Alternatively, since we support selects, if there's a few fonts that you think are good you could curate them yourself and put them into a select? ``` // font select for left eye font_l_eye = "Arial Black"; // ["DejaVu Serif","Arial Black", "URW Gothic L"] ``` ![image](https://user-images.githubusercontent.com/29681384/132142217-9e975991-a8e7-4ff7-861f-e63ef5c7db97.png) @t-paul I should be able to work with what ever is decided if that's something you want to add. Since the format for string params is already ``` { "caption": "Text box for string with length 8", "group": "Parameters", "initial": "length", "maxLength": 8, "name": "stringMaxLength", "type": "string" } ``` You could keep the type as string since that's what it is fundamentally and add `input: "font"` or `font-select` in? That way it's backwards compatible, just defaults back to a regular string input if the select isn't supported? Don't know what the syntax might be? `// [::font-select]` 🤷 ?
JustinSDK commented 2021-09-06 01:54:19 +02:00 (Migrated from github.com)

@Irev-Dev

It seems that font setting is ok when using customizer.

image

but not working in the editor.

image

@Irev-Dev It seems that font setting is ok when using customizer. ![image](https://user-images.githubusercontent.com/3424741/132144713-97e63de0-6e2d-4aa2-b94e-55db24a5f087.png) but not working in the editor. ![image](https://user-images.githubusercontent.com/3424741/132144854-9ef40d3e-3330-41e5-aad1-00cd8d2e6105.png)
Irev-Dev commented 2021-09-06 23:15:09 +02:00 (Migrated from github.com)

ahh @JustinSDK, I think thats just because the customizer always overrules with its values, most likely even when its shut. I think if you refreshed the page it would then respect the script, but thats a good find.
Not sure of what the best approach is, maybe reset the customizer if the script changes?

ahh @JustinSDK, I think thats just because the customizer always overrules with its values, most likely even when its shut. I think if you refreshed the page it would then respect the script, but thats a good find. Not sure of what the best approach is, maybe reset the customizer if the script changes?
hrgdavor commented 2021-09-06 23:22:19 +02:00 (Migrated from github.com)

Not sure of what the best approach is, maybe reset the customizer if the script changes?

I would not like if customizer is reset on script change.

A reset button that reverts customizer values to inital values from the script would be a good compromise (I have this implemented in my own prototype of jscad, and I find it personally extremely useful)

> Not sure of what the best approach is, maybe reset the customizer if the script changes? I would not like if customizer is reset on script change. A reset button that reverts customizer values to inital values from the script would be a good compromise (I have this implemented in my own prototype of jscad, and I find it personally extremely useful)
Irev-Dev commented 2021-09-27 00:48:44 +02:00 (Migrated from github.com)

Do you have any feed back on this approach to the customizer @JustinSDK ?
https://github.com/Irev-Dev/cadhub/pull/529#issuecomment-927193171

Do you have any feed back on this approach to the customizer @JustinSDK ? https://github.com/Irev-Dev/cadhub/pull/529#issuecomment-927193171
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: h3n3/cadhub#488