Code Monkey home page Code Monkey logo

font_metrics's Introduction

FontMetrics

Build Status Codecov

Update

Version 0.5 has several major chagnes, including wrapping at word boudaries and, frankly, fixes a bug when calculating the widths.

It also removes serialization and now just returns the struct. This library shouldn't have an opinion on how you want to serialize it's data. I suggest you use something like :erlang.term_to_binary to get it done. Scenic no longer needs this functionality and that really pointed out how it shouldn't be here.

Overview

This library works with pre-generated font metrics data to explore and calculate various measurements of text in a given font and size.

For example, if you want to know how wide or tall a string of text will be when it is rendered in a given font at a given size, then this can help you out.

This library is intended to be used with the Scenic framework, but doesn't depend on it, so it is usable elsewhere.

Installation

If available in Hex, the package can be installed by adding font_metrics to your list of dependencies in mix.exs:

def deps do
  [
    {:font_metrics, "~> 0.5"}
  ]
end

Generating Metrics

You will need to use another package to compile the font metrics data from a font.

This can be done with the truetype_metrics package. Look for it on hex... In the meantime, metrics data for both Roboto and RobotoMono can be found in the Scenic project.

font_metrics's People

Contributors

boydm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

font_metrics's Issues

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.