Styling reference
This page list the most common styling properties supported by MyScript iink SDK.
MyScript iink SDK makes it easy to style content using CSS properties listed in this page. In addition to these css styling properties, you can adjust its default configuration with different options presented here.
Restrictions from CSS
The following restrictions apply:
- Only a limited subset of CSS properties is supported.
- Supported types are different from regular CSS types (e.g. type selectors like
h1,pordivare not supported). - The default unit is
mmand properties provided with an explicit unit will be ignored. - Keywords such as
inherit,initialorunsetare not supported. - Universal selector (
*) and combinators are not supported. - Possibilities to express colors are constrained.
Available classes and properties
glyph type
MyScript iink SDK exposes the glyph type that allows you to specify fonts properties for all converted text glyphs:
| Property | Default value | Remarks |
|---|---|---|
font-family | "sans-serif" | |
font-style | normal | |
font-variant | normal | |
font-weight | 300 | Only numerical values are supported. |
In addition, the following classes and properties are available that are specific to each content type:
Diagram block
.diagram is the default class for items in a "Diagram" content block:
| Property | Default value | Remarks |
|---|---|---|
font-family | "sans-serif" | |
font-style | normal | |
font-variant | normal | |
font-weight | 300 | Only numerical values are supported. |
Math block
.math is the default class for items in a "Math" content block:
| Property | Default value | Remarks |
|---|---|---|
font-family | STIX Two Math | |
font-style | normal | |
font-variant | normal | |
font-weight | 300 | Only numerical values are supported. |
color | #000000FF | See possible values. |
.math-variable defines the style applied to the variables after ink conversion:
| Property | Default value | Remarks |
|---|---|---|
font-family | STIX Two Text | |
font-style | italic | |
font-variant | normal | |
font-weight | 300 | Only numerical values are supported. |
color | #000000FF | See possible values. |
.math-solved defines the style applied to the glyphs that are generated by the solver:
| Property | Default value | Remarks |
|---|---|---|
font-family | STIX Two Math | |
font-style | normal | |
font-weight | 300 | Only numerical values are supported. |
color | #A8A8A8FF | See possible values. |
Text block
.text is the default class for items in a "Text" content block:
| Property | Default value | Remarks |
|---|---|---|
font-family | "sans-serif" | |
font-style | normal | |
font-variant | normal | |
font-weight | 300 | Only numerical values are supported. |
font-size | None | In millimeters (model unit). |
line-height | None | Multiplier of the font size. |
Note that iink computes the default line height and font size based on the device resolution instead of using a static css containing default values.
You can modify font-size and line-height values to adjust the guides spacing, but note that "Text" and "Text Document" guides spacings are not identical.
- For "Text" parts, the spacing of handwriting guides (if enabled) is given by
font-size*line-height. - For "Text Document" parts, the guides spacing considers the
font-sizeandline-heightproduct too. But some more computation adjusts the line gap.
For instance, the following CSS will correspond to a 13-millimeter spacing when the theme is set to a "Text" part. For a "Text Document" part, the example is still valid but the outcome might be slightly different.
.text {
font-size: 10;
line-height: 1.3;
}
Raw Content block
.raw-content is the default class for items in a "Raw Content" block:
| Property | Default value | Remarks |
|---|---|---|
font-family | "sans-serif" | |
font-style | normal | |
font-variant | normal | |
font-weight | 300 | Only numerical values are supported. |
.raw-content-grid is the default class of the "Raw Content" block background pattern , when the raw-content.line-pattern is grid, dots or lines:
| Property | Default value | Remarks |
|---|---|---|
color | #00000011 | See possible values. |
Possible values
Colors
Colors can be specified as rgb(), rgba(), hsl(), hsla(), #rgb, #rgba, #rrggbb, #rrggbbaa.
Named colors (black, red, etc.) are not supported.
-myscript-pen-brush
- Possible values for built-in pen brushes are:
Polyline,FountainPen,CalligraphicQuill,CalligraphicBrush,QalamandFeltPen. - In addition, you can implement additional brushes whose names must start with the prefix
Extra-, such asExtra-Pencilin the Android demo example. - Unknown values (including extra ones) fallback to
FeltPen.
-myscript-pen-orientation-sensitivity
This property values range from 0 to 1, with a default value of 0 meaning there is no effect and 1 meaning full sensitivity.
-myscript-pen-tilt-sensitivity
This property values range from 0 to 1, with a default value of 0 meaning there is no effect and 1 meaning full sensitivity.
-myscript-pen-pressure-sensitivity
This property values range from 0 to 1, with a default value of 0 meaning there is no effect and 1 meaning full sensitivity.