openscad / openscad-playground

OpenSCAD Web Playground
https://ochafik.com/openscad2
Other
76 stars 17 forks source link

How I can add more fonts? #21

Open xlmnxp opened 5 months ago

xlmnxp commented 5 months ago

Hello, I have the following code

/*
  Hello there!

  If you're new to OpenSCAD, please learn the basics here:
  https://openscad.org/documentation.html

  There are lots of amazing libraries in the OpenSCAD ecosystem
  (see this list: https://openscad.org/libraries.html).

  Some of these libraries are bundled with this playground
  (search for "demo" or "example" in the file explorer above)
  and can be included directly from your models.

  Any bugs (this is an Alpha!) or ideas of features?
  https://github.com/openscad/openscad-playground/issues/new
*/

// Click on Render or hit F6 to do a fine-grained rendering.
$fn=$preview ? 20 : 100;

translate([-24,0,0]) {
  union() {
    cube(15, center=true);
    sphere(10);
  }
}

intersection() {
  cube(15, center=true);
  sphere(10);
}

translate([24,0,0]) {
  difference() {
    cube(15, center=true);
    sphere(10);
  }
}

translate([0, -30, -12])
  linear_extrude(1)
    text("السلام", halign="center", valign="center", font="Noto Sans Arabic");

it contain Arabic word but it don't render in playground correctly image

but it render fine inside OpenSCAD image

ochafik commented 1 month ago

@xlmnxp if you know of any good font(s) w/ Arabic script (& more) in a compatible OSS license, we should be able to ship them in the playground. For now the Makefile only bundles these.

Might also need an update to https://github.com/openscad/openscad-playground/blob/f52f8d5333c904ade0ee1e212212a4f547a68a49/src/fs/zip-archives.ts#L24

xlmnxp commented 1 month ago

@ochafik noto sans arabic