New FeatureScript predicate: Fontpicker

jnewth_onshape
jnewth_onshape Member, Onshape Employees Posts: 89 image
I have published Fontpicker R1. You can find it here: https://cad.onshape.com/documents/0fef4e86805ae7e232be4d16/v/1decb6f4e1ef91711d5892a6/e/4522968d16630da6fe5ce8b8

Please note: This document doesn't define a feature itself. Rather, it defines a predicate to be incorporated in to your FeatureScript preconditions. This predicate creates the UI to allow a user to select any Onshape-supported font. 

This document includes an example custom feature that uses the Fontpicker predicate. In this example feature, the user is able to select any supported font and weight. The custom feature retrieves these specifications, constructs a valid font string, and then uses that font string in a skText operation:


If you have questions please post them in the comments.


Comments

  • DavisParker
    DavisParker OS Professional Posts: 16 ✭✭
    Is there a way you could prevent invalid combinations? By choosing BoldItalic and cycling a few fonts you will notice that they all look the same. I assume this is because they default to something.
  • jnewth_onshape
    jnewth_onshape Member, Onshape Employees Posts: 89 image
    I think I could make an exclusion set. I have to figure out which are valid but that shouldn't be too hard.