Giter VIP home page Giter VIP logo

go-fonts's Introduction

go-fonts: Render open source fonts to polygons in Go

GoDoc Test Status

This is an experimental package used to render open source fonts to polygons using Go.

Example usage

To use one or more fonts within a Go program, import the main package and the font(s) you want, like this:

import (
  "github.com/gmlewis/go-fonts/fonts"
  _ "github.com/gmlewis/go-fonts/fonts/ubuntumonoregular"
)

Then render the text to polygons and use them however you want:

  render, err := fonts.Text(xPos, yPos, xScale, yScale, message, "ubuntumonoregular", Center)
  if err != nil {
    return err
  }
  log.Printf("MBB: %v", render.MBB)
  for _, poly := range render.Polygons {
    // ...
  }

See https://github.com/gmlewis/go-gerber for an example application that uses this package.


Enjoy!


License

Copyright 2019-2024 Glenn M. Lewis. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


Font samples

aaarghnormal abeezee_italic abeezee_regular acme_regular aguafinascript_regular aileron_black aileron_blackitalic aileron_bold aileron_bolditalic aileron_heavy aileron_heavyitalic aileron_italic aileron_light aileron_lightitalic aileron_regular aileron_semibold aileron_semibolditalic aileron_thin aileron_thinitalic aileron_ultralight aileron_ultralightitalic airstream alexbrush_regular alfaslabone_regular allura_regular amerika amerikasans amita_bold amita_regular anagram aquilinetwo arizonia_regular asset_regular atomicage_regular baloo baskervville_italic baskervville_regular berkshireswash_regular bitstreamverasansmono_bold bitstreamverasansmono_boldob bitstreamverasansmono_oblique bitstreamverasansmono_roman blazium cacchampagne carrelectronicdingbats coiny_regular combinumeralsltd davysregular deliusswashcaps_regular diplomata_regular dited edwin_bdita edwin_bold edwin_italic edwin_roman embossedblack_normal embossedblackwide_normal englandhanddb entypo f20db f2dumb fantasquesansmono_bold fantasquesansmono_bolditalic fantasquesansmono_italic fantasquesansmono_regular fascinate_inlineregular fauxsnowbrk floralia font3933 fontleroybrown freebooterscript freemono freemonobold freemonoboldoblique freemonooblique freesans freesansbold freesansboldoblique freesansoblique freeserif freeserifbold freeserifbolditalic freeserifitalic genzschetheyse genzschetheysealternate geometrysoftpro_boldn gooddogregular goudystm goudystm_italic grandhotel_regular gravitasone greatvibes_regular grutchshaded hanalei_regular hanaleifill_regular headhunter_regular heavydata helsinkiregular heydingsicons im_fell_flowers_2 impactlabel impactlabelreversed incisedblack_normal incisedblackwide_normal inconsolata italianno_regular kawoszeh kellssd kingthingsitalique kingthingsxstitch konstytucyja landliebe latoregular leaguescriptthin_regular lobstertwo lobstertwo_bold lobstertwo_bolditalic lobstertwo_italic loversquarrel_regular membra miama modak monospacetypewriter monoton_regular montez_regular mothproofscript oi_regular overlockregular oxygen oxygen_bold oxygen_bolditalic oxygen_italic oxygenmono_regular pacifico parisienne_regular pixelcode pixelcode_black pixelcode_blackitalic pixelcode_bold pixelcode_bolditalic pixelcode_demibold pixelcode_demibolditalic pixelcode_extrablack pixelcode_extrablackitalic pixelcode_extrabold pixelcode_extrabolditalic pixelcode_extralight pixelcode_extralightitalic pixelcode_italic pixelcode_light pixelcode_lightitalic pixelcode_medium pixelcode_mediumitalic pixelcode_thin pixelcode_thinitalic plainblack_normal plainblackwide_normal plasmadripbrk plasmadripemptybrk princesssofia printbold printclearly printdashed printersornamentsone promocyja qwigley_regular ralewaydots_regular rammettoone_regular rechtmanplain rothenburgdecorative_normal rougescript_regular rubik_black rubik_blackitalic rubik_bold rubik_bolditalic rubik_italic rubik_light rubik_lightitalic rubik_medium rubik_mediumitalic rubik_regular ruthie_regular rye_regular sail_regular satisfy_regular scratch scriptinapro sevillana_regular sfarcheryblack sfarcheryblack_oblique sfarcheryblacksc sfarcheryblacksc_oblique sfwasabi sfwasabicondensed shojumaru_regular shortstack shrikhand_regular simpel_medium sjonarbok_classic snickles sniglet_extrabold sniglet_regular sofia_regular solveigbold solveigbold_italic solveigdemibold solveigdemibold_italic solveigdisplay solveigdisplay_italic solveigtext solveigtext_italic sonsieone soria_soria soucisans spacemono_bold spacemono_bolditalic spacemono_italic spacemono_regular spiltink spirax_regular sportrop_regular squadaone_regular stardosstencil_bold stardosstencil_regular stateface_regular stmarie_thin symbolsigns_basisset synthetiqueot tangerine tangerine_bold teutonicno1_demibold teutonicno2_demibold teutonicno3_demibold teutonicno4_demibold texgyreadventor_bold texgyreadventor_bolditalic texgyreadventor_italic texgyreadventor_regular titanone topsecret_bold typemymusic_notation ubuntumonoregular vanilla vastshadow_regular veggieburger veggieburger_bold veggieburger_light veterantypewriter vibur wcsoldoutabta wcsoldoutbbta wcsoldoutcbta websymbols_regular wellfleet_regular windsong woodennickelblack yataghan yellowtail yesevaone zenda znikomit znikomitno24

go-fonts's People

Contributors

gmlewis avatar dependabot[bot] avatar

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.