Socket
Socket
Sign inDemoInstall

msdf-fonts

Package Overview
Dependencies
182
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    msdf-fonts

MSDF files typically used for frontend rendering of text in WebGL


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

msdf-fonts

Repository for MSDF font files for rendering 2D text in WebGL To learn more about MSDF, see this repo https://github.com/Chlumsky/msdfgen

How to use

In your application code, use any CDN for Open Source Projects like jsdelivr or cdnjs to reference your desired font. You can access the full font files under /build/, or subsets of characters based on Unicode Blocks under /build/subsets/ if you want to load smaller files

let fontJSON = "https://cdn.jsdelivr.net/npm/msdf-fonts/build/OpenSans-Regular-msdf.json";
let fontImage = "https://cdn.jsdelivr.net/npm/msdf-fonts/build/OpenSans-Regular-msdf.png";
Character Subsets

The following Character Subsets are currently supported if you want to load smaller files. These files are located in the /build folder as follows: /build/subsets/{characterSet}-{fontFamily}-{weight+style}-msdf.{png|json}

Character Set NameIncludesList of Characters
basic-latin !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~
latin-1-supplementbasic-latin ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ
latin-extended-abasic-latin, latin-1-supplementĀāĂ㥹ĆćĈĉĊċČčĎďĐđĒēĔĕĖėĘęĚěĜĝĞğĠġĢģĤĥĦħĨĩĪīĬĭĮįİıIJijĴĵĶķĸĹĺĻļĽľĿŀŁłŃńŅņŇňʼnŊŋŌōŎŏŐőŒœŔŕŖŗŘřŚśŜŝŞşŠšŢţŤťŦŧŨũŪūŬŭŮůŰűŲųŴŵŶŷŸŹźŻżŽžſ
greekbasic-latinͰͱͲͳʹ͵Ͷͷ͸͹ͺͻͼͽ;Ϳ΀΁΂΃΄΅Ά·ΈΉΊ΋Ό΍ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ΢ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώϏϐϑϒϓϔϕϖϗϘϙϚϛϜϝϞϟϠϡϢϣϤϥϦϧϨϩϪϫϬϭϮϯϰϱϲϳϴϵ϶ϷϸϹϺϻϼϽϾϿ
cyrillicbasic-latinЀЁЂЃЄЅІЇЈЉЊЋЌЍЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюяѐёђѓєѕіїјљњћќѝўџѠѡѢѣѤѥѦѧѨѩѪѫѬѭѮѯѰѱѲѳѴѵѶѷѸѹѺѻѼѽѾѿҀҁ҂҃҄҅҆҇҈҉ҊҋҌҍҎҏҐґҒғҔҕҖҗҘҙҚқҜҝҞҟҠҡҢңҤҥҦҧҨҩҪҫҬҭҮүҰұҲҳҴҵҶҷҸҹҺһҼҽҾҿӀӁӂӃӄӅӆӇӈӉӊӋӌӍӎӏӐӑӒӓӔӕӖӗӘәӚӛӜӝӞӟӠӡӢӣӤӥӦӧӨөӪӫӬӭӮӯӰӱӲӳӴӵӶӷӸӹӺӻӼӽӾӿ
Adding fonts
  • Create a folder for the new font family in all lowercase under /fonts
  • Add all your .ttf files to that new folder
  • Add the name of the font folder to FontFamilies.js in the fontFolders list
  • (Optionally) Add your font folder name to the relavant Character Sets in CharacterSets.js
  • Run npm start
  • Open a pull request :)
Adding Character Sets to support more languages

Create a GitHub issue with details for your Character Set. Ideally you provide information about what Unicode Blocks would be used (You can see blocks here). If that confuses you, just open a pull request anyways and I'll try to help the best I can

Adding Custom Character Sets

I'll probably say no, but you can try and ask anyways if you have a good reason

Please Help

If you have any ideas on how to better structure this repo, I'd love to hear you out! Don't hesitate to reach out with a GitHub issue detailing your ideas

Keywords

FAQs

Last updated on 07 Apr 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc