GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - study-game-engines/ttf-java: Java library for OpenType font file parsing, support converting to an image

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

19 Commits
19 Commits

Folders and files

NameName
Last commit message
Last commit date
src
src
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README-zh.md
README-zh.md
 
 
README.md
README.md
 
 
pom.xml
pom.xml
 
 

Repository files navigation

opentype4j

Java library for OpenType font file parsing

API

Loading a font

Font font = OpenType.parse(filePath);
System.out.println(font.getPath("you are right").toSVG())

The Font object

A Font represents a loaded OpenType font file.

Font.getPath(String text)

Convert specified to a Path object with default size.

Font.getPath()

Convert all glyph to a Path object with default size. (default: 16 fonts in one line and per font with size of 44*40)

Font.nameToGlyph(String name)

Convert the given glyph name to a single GlyphData object.

The GlyphData object

A Glyph is an individual mark that often corresponds to a character.

GlyphData.getPath()

Get a glyph Path object with default size(44*40) we can use to export(eg. saving as a svg file).

GlyphData.getPath(FontCell fontCell)

Get a glyph Path object with specified size(fontCell) we can use to export(eg. saving as a svg file).

  • fontCell: An outer bounds of a cell where a font will be rendered in

The Path object

A Path containing a set of path commands similar to a SVG path.

Path.toSVG()

Convert the path to a string of svg dom.

Path.toSVG(String filePath)

Save the path as a svg file which locate in the filePath

Path.toImage(File file)

Save the path as a JPEG file

Path.toImage(File file, ImageFormat format)

Save the path as an image file specified by format. Supporting for JPEG or PNG format currently

Path.toImageBytes()

Convert the path to byte array of a jpeg image

Path.toImageBytes(ImageFormat format)

Convert the path to byte array of specified image format

License

MIT

About

Java library for OpenType font file parsing, support converting to an image

Resources

Readme
License
Activity
Custom properties

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.