<commit_before>#
# Copyright (c) 2013 by Lifted Studios.  All Rights Reserved.
#

require 'ttfunk'

module KangaRuby
  # Represents error that occurs when a font does not contain a Unicode map.
  class MissingUnicodeMapError < StandardError
  end

  # Embodies a TrueType font, allowing for calculation of visual sizes of strings.
  #
  # Sources
  # * [FreeType Glyph Conventions](http://freetype.sourceforge.net/freetype2/docs/glyphs/index.html)
  # * [TrueType Fundamentals](http://www.microsoft.com/typography/otspec/TTCH01.htm)
  #
  # All measurements for the font have been normalized to 1,000 units per em.  Because
  # each font can have drastically differing scales (from 16 to 16,384 units per em),
  # this allows for a unified set of math to be used for conversions to pixels or inches.
  #
  # All conversions to pixels or inches have been based off of an assumption of 72 DPI (dots
  # or pixels per inch) because that makes the math easy.  This means that 1 point (using
  # the typographic term) is equal to 1 pixel, so a 12 point font would be approximately
  # 12 pixels high.
  class Font<commit_msg>Make the documentation more readable<commit_after>#
# Copyright (c) 2013 by Lifted Studios.  All Rights Reserved.
#

require 'ttfunk'

module KangaRuby
  # Represents error that occurs when a font does not contain a Unicode map.
  class MissingUnicodeMapError < StandardError
  end

  # Embodies a TrueType font, allowing for calculation of visual sizes of strings.
  #
  # All measurements for the font have been normalized to 1,000 units per em.  Because
  # each font can have drastically differing scales (from 16 to 16,384 units per em),
  # this allows for a unified set of math to be used for conversions to pixels or inches.
  #
  # All conversions to pixels or inches have been based off of an assumption of 72 DPI (dots
  # or pixels per inch) because that makes the math easy.  This means that 1 point (using
  # the typographic term) is equal to 1 pixel, so a 12 point font would be approximately
  # 12 pixels high.
  #
  # ## Sources
  #
  # * [FreeType Glyph Conventions](http://freetype.sourceforge.net/freetype2/docs/glyphs/index.html)
  # * [TrueType Fundamentals](http://www.microsoft.com/typography/otspec/TTCH01.htm)
  #
  class Font
{'fraction_non_alphanumeric': 0.06684256816182937, 'fraction_numerical': 0.022867194371152155, 'mean_word_length': 3.7395833333333335, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2810072', 'n_tokens_mistral': 719, 'n_tokens_neox': 643, 'n_words': 299}