diff --git a/docs/docs/general-cadhub/openscad-fonts.mdx b/docs/docs/general-cadhub/openscad-fonts.mdx index 4b6d351..84791f1 100644 --- a/docs/docs/general-cadhub/openscad-fonts.mdx +++ b/docs/docs/general-cadhub/openscad-fonts.mdx @@ -2,122 +2,258 @@ title: OpenSCAD Fonts --- -Fonts that are available for use within the CadHub OpenSCAD IDE listed below, or see this [Cadhub Project](https://cadhub.xyz/u/irevdev/all-scad-fonts) for a demo of them in use. + + +Fonts that are available for use within the CadHub OpenSCAD IDE listed at the bottom of this page. + +### Using fonts +The way to use the fonts with `text()` is to ether use +`font=""` +or +`font=":style="` + +An example of both would be: ``` -DejaVu Serif -URW Bookman -URW Bookman -DejaVu Sans Mono -Nimbus Mono PS -P052 -URW Gothic -Nimbus Roman No9 L -DejaVu Sans -Nimbus Sans -URW Bookman -Nimbus Sans Narrow -Nimbus Sans -C059 -Nimbus Roman No9 L -Nimbus Mono PS -URW Gothic -URW Palladio L -Nimbus Mono L -URW Chancery L -URW Bookman -Nimbus Sans Narrow -Century Schoolbook L -Nimbus Sans Narrow -Nimbus Sans -Nimbus Mono PS -Nimbus Roman -Z003 -Nimbus Sans -URW Gothic -Dingbats -Nimbus Roman No9 L -D050000L -Nimbus Sans L -C059 -DejaVu Sans -URW Gothic L -Nimbus Roman -C059 -Nimbus Mono PS -Nimbus Roman -Nimbus Sans Narrow -Nimbus Roman -Nimbus Sans L -Droid Sans Fallback -URW Palladio L -C059 -Nimbus Roman -Nimbus Sans -Nimbus Mono L -URW Bookman -URW Gothic L -URW Gothic -DejaVu Sans Mono -Nimbus Roman -Nimbus Mono PS -Nimbus Sans Narrow -Nimbus Sans L -URW Bookman -Nimbus Mono PS -Nimbus Sans -Nimbus Sans -Nimbus Sans L -Nimbus Mono PS -Standard Symbols PS -URW Gothic -URW Gothic L -Nimbus Roman No9 L -Standard Symbols L -Nimbus Sans Narrow -URW Bookman -URW Gothic -URW Bookman L -Century Schoolbook L -Z003 -P052 -C059 -URW Gothic L -P052 -Nimbus Roman -Nimbus Sans Narrow -P052 -D050000L -Standard Symbols PS -Nimbus Sans L -URW Bookman L -Noto Mono -URW Gothic -Nimbus Sans -C059 -Nimbus Mono PS -Century Schoolbook L -Nimbus Mono L -Nimbus Sans L -URW Bookman L -URW Palladio L -URW Gothic -P052 -Nimbus Sans L -URW Bookman L -Nimbus Mono L -P052 -Nimbus Sans Narrow -C059 -Century Schoolbook L -URW Palladio L -URW Bookman -DejaVu Serif -P052 -C059 -P052 -Nimbus Roman -Nimbus Sans L +sampleText="the quick brown fox jumped over the lazy dog"; +text(sampleText, font = "DejaVu Sans", size=6); +translate([0,-10,0]) + text(sampleText, font = "DejaVu Sans:style=bold", size=6); +``` + +### Use with the customizer +If you would like to offer font selection to users with the customizer, the best way is to add a curated list using a select. + +For example: +``` +// font selection +font = "DejaVu Serif"; // ["DejaVu Serif", "URW Gothic L", "URW Bookman"] +``` + + + +### Relevant Links +- [Cadhub Project](https://cadhub.xyz/u/irevdev/all-scad-fonts) for a demo of them in use +- [Relevant discussion](https://github.com/Irev-Dev/cadhub/issues/488#issuecomment-913222319) about potentially adding a font select in the customizer. +- [OpenSCAD `text()` docs](https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/Text) + +### Fonts +``` +font: C059 +styles: Bold, Bold Italic, Italic, Roman + +font: Century Schoolbook L +styles: Bold Italic, Bold, Italic, Roman + +font: D050000L +styles: Regular + +font: DejaVu Sans +styles: Bold, Book + +font: DejaVu Sans Mono +styles: Bold, Book + +font: DejaVu Serif +styles: Book, Bold + +font: Dingbats +styles: Regular + +font: Droid Sans Fallback +styles: Regular + +font: Nimbus Mono L +styles: Bold Oblique, Bold, Regular Oblique, Regular + +font: Nimbus Mono PS +styles: Bold, Bold Italic, Regular, Italic + +font: Nimbus Roman +styles: Italic, Bold, Regular, Bold Italic + +font: Nimbus Roman No9 L +styles: Regular, Regular Italic, Medium, Medium Italic + +font: Nimbus Sans +styles: Italic, Bold, Bold Italic, Regular + +font: Nimbus Sans L +styles: Regular, Bold, Bold Italic, Regular Italic, Bold Condensed, Regular Condensed, Bold Condensed Italic, Regular Condensed Italic + +font: Nimbus Sans Narrow +styles: Regular, Oblique, Bold, Bold Oblique + +font: Noto Mono +styles: Regular + +font: P052 +styles: Bold, Roman, Italic, Bold Italic + +font: Standard Symbols L +styles: Regular + +font: Standard Symbols PS +styles: Regular + +font: URW Bookman +styles: Light, Demi Italic, Demi, Light Italic + +font: URW Bookman L +styles: Demi Bold, Light Italic, Light, Demi Bold Italic + +font: URW Chancery L +styles: Medium Italic + +font: URW Gothic +styles: Demi Oblique, Demi, Book Oblique, Book + +font: URW Gothic L +styles: Demi Oblique, Book Oblique, Demi, Book + +font: URW Palladio L +styles: Bold Italic, Roman, Bold, Italic + +font: Z003 +styles: Medium Italic ```