Giter Site home page Giter Site logo

openscad-text's Introduction

openscad-text

A ruby gem to generate text in openscad with system fonts easily.

Installation:

You need ruby installed on your machine, on linux simply type:

\curl -sSL https://get.rvm.io | bash -s stable --with-gems="openscad-text"

This will install the ruby interpreter and the openscad-text gem.

Those who already have ruby installed can simply type the following to install the gem:

gem install openscad-text

Usage:

Create a file called nice_text.rb with the following content:

require 'openscad-text'

font = Text.available_fonts.find { |f| f =~ /times/ }
text = Text.new("Nice Text!", font)
puts text.to_openscad

If you're on Linux you can use the little script above like so:

ruby nice_text.rb > nice_text.scad

This will create a new file called nice_text.scad, which will contain the text as openscad model.

Have a look at the examples/ directory to see more! ;)

Examples:

Times new Roman! Comic Sans! Arial

openscad-text's People

Contributors

flo-l avatar

Watchers

 avatar  avatar

openscad-text's Issues

Porting to Python

Hi, I'm interested to port your library to Python, but I don't really understand the algorithms on a high level.

How is the font rendering done? Do you extract it to some vector path before exporting to OpenSCAD?
What kind of helper libraries help with that?

Thanks a lot

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.