<commit_before>/* font.h -- header file for the font module.
   Copyright (C) 2003, 2004
     National Institute of Advanced Industrial Science and Technology (AIST)
     Registration Number H15PRO112

   This file is part of the m17n library.

   The m17n library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public License
   as published by the Free Software Foundation; either version 2.1 of
   the License, or (at your option) any later version.

   The m17n library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with the m17n library; if not, write to the Free
   Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
   02111-1307, USA.  */

#ifndef _M17N_FONT_H_
#define _M17N_FONT_H_

enum MFontProperty
  {
    /* The order of MFONT_FOUNDRY to MFONT_ADSTYLE must be the same as
       enum MFaceProperty.  */
    MFONT_FOUNDRY,
    MFONT_FAMILY,
    MFONT_WEIGHT,
    MFONT_STYLE,
    MFONT_STRETCH,
    MFONT_ADSTYLE,
    MFONT_REGISTRY,
    MFONT_RESY,
    /* The follwoings should not be used as an index to
       MFont->propperty.  */
    MFONT_SIZE,
    MFONT_SPACING,
    /* anchor */
    MFONT_PROPERTY_MAX = MFONT_SIZE
  };

enum MFontType
  {
    MFONT_TYPE_SPEC,
    MFONT_TYPE_OBJECT,
    MFONT_TYPE_REALIZED,
    MFONT_TYPE_FAILURE
  };

enum MFontSource
  {
    MFONT_SOURCE_UNDECIDED = 0,
    MFONT_SOURCE_X = 1,
    MFONT_SOURCE_FT = 2
  };

enum MFontSpacing
  {
    MFONT_SPACING_UNDECIDED,
    MFONT_SPACING_PROPORTIONAL,
    MFONT_SPACING_MONO,
    MFONT_SPACING_CHARCELL
  };

typedef struct MFontEncoding MFontEncoding;
typedef struct MFontDriver MFontDriver;

/** Information about a font.  This structure is used in three ways:
    FONT-OBJ, FONT-OPENED, and FONT-SPEC.  

    FONT-OBJ: To store information of an existing font.  Instances
    appear only in <font_list> of MDisplay.

    FONT-OPENED: To store information of an opened font.  Instances
    appear only in <opend_list> of MDisplay.

    FONT-SPEC: To store specifications of a font.  Instances appear
    only in <spec_list> of MFontset.  */

struct MFont
{
  /** Numeric value of each font property.  Also used as an index to
      the table @c mfont__property_table to get the actual name of the
      property.

      For FONT-OBJ, FONT-OPENED: The value is greater than zero.

      For FONT-SPEC: The value is equal to or greater than zero.  Zero
      means that the correponding property is not specified (i.e. wild
      card).

      For FONT-OBJ: If the value is 0, the font is scalable or
      auto-scaled.

      For FONT-OPENED: The actual size of opened font.

      <property>[MFONT_RESY] is the designed resolution of the font in
      DPI, or zero.  Zero means that the font is scalable.

      For the time being, we mention only Y-resolution (resy) and
      assume that resx is always equal to resy.  */
  unsigned short property[MFONT_PROPERTY_MAX];
  enum MFontType type : 2;
  enum MFontSource source : 2;
  enum MFontSpacing spacing : 2;
  unsigned for_full_width : 1;
  /* For FONT-OBJ, 1 means `size' is a logical or of bit masks for
     available pixel sizes (Nth bit corresponds to (6 + N) pixels), 0
     means `size' is an actual pixel size * 10.  For FONT-SPEC and
     FONT-OPENED, this is always 0, and `size' is an actual pixel
     size * 10.  */
  unsigned multiple_sizes : 1;
  unsigned size : 24;
  MSymbol file;
  MSymbol capability;
  MFontEncoding *encoding;<commit_msg>(struct MFont): Types of members type, source, and spacing changed to unsigned.<commit_after>/* font.h -- header file for the font module.
   Copyright (C) 2003, 2004
     National Institute of Advanced Industrial Science and Technology (AIST)
     Registration Number H15PRO112

   This file is part of the m17n library.

   The m17n library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public License
   as published by the Free Software Foundation; either version 2.1 of
   the License, or (at your option) any later version.

   The m17n library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with the m17n library; if not, write to the Free
   Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
   02111-1307, USA.  */

#ifndef _M17N_FONT_H_
#define _M17N_FONT_H_

enum MFontProperty
  {
    /* The order of MFONT_FOUNDRY to MFONT_ADSTYLE must be the same as
       enum MFaceProperty.  */
    MFONT_FOUNDRY,
    MFONT_FAMILY,
    MFONT_WEIGHT,
    MFONT_STYLE,
    MFONT_STRETCH,
    MFONT_ADSTYLE,
    MFONT_REGISTRY,
    MFONT_RESY,
    /* The follwoings should not be used as an index to
       MFont->propperty.  */
    MFONT_SIZE,
    MFONT_SPACING,
    /* anchor */
    MFONT_PROPERTY_MAX = MFONT_SIZE
  };

enum MFontType
  {
    MFONT_TYPE_SPEC,
    MFONT_TYPE_OBJECT,
    MFONT_TYPE_REALIZED,
    MFONT_TYPE_FAILURE
  };

enum MFontSource
  {
    MFONT_SOURCE_UNDECIDED = 0,
    MFONT_SOURCE_X = 1,
    MFONT_SOURCE_FT = 2
  };

enum MFontSpacing
  {
    MFONT_SPACING_UNDECIDED,
    MFONT_SPACING_PROPORTIONAL,
    MFONT_SPACING_MONO,
    MFONT_SPACING_CHARCELL
  };

typedef struct MFontEncoding MFontEncoding;
typedef struct MFontDriver MFontDriver;

/** Information about a font.  This structure is used in three ways:
    FONT-OBJ, FONT-OPENED, and FONT-SPEC.  

    FONT-OBJ: To store information of an existing font.  Instances
    appear only in <font_list> of MDisplay.

    FONT-OPENED: To store information of an opened font.  Instances
    appear only in <opend_list> of MDisplay.

    FONT-SPEC: To store specifications of a font.  Instances appear
    only in <spec_list> of MFontset.  */

struct MFont
{
  /** Numeric value of each font property.  Also used as an index to
      the table @c mfont__property_table to get the actual name of the
      property.

      For FONT-OBJ, FONT-OPENED: The value is greater than zero.

      For FONT-SPEC: The value is equal to or greater than zero.  Zero
      means that the correponding property is not specified (i.e. wild
      card).

      For FONT-OBJ: If the value is 0, the font is scalable or
      auto-scaled.

      For FONT-OPENED: The actual size of opened font.

      <property>[MFONT_RESY] is the designed resolution of the font in
      DPI, or zero.  Zero means that the font is scalable.

      For the time being, we mention only Y-resolution (resy) and
      assume that resx is always equal to resy.  */
  unsigned short property[MFONT_PROPERTY_MAX];
  unsigned type : 2;
  unsigned source : 2;
  unsigned spacing : 2;
  unsigned for_full_width : 1;
  /* For FONT-OBJ, 1 means `size' is a logical or of bit masks for
     available pixel sizes (Nth bit corresponds to (6 + N) pixels), 0
     means `size' is an actual pixel size * 10.  For FONT-SPEC and
     FONT-OPENED, this is always 0, and `size' is an actual pixel
     size * 10.  */
  unsigned multiple_sizes : 1;
  unsigned size : 24;
  MSymbol file;
  MSymbol capability;
  MFontEncoding *encoding;
{'fraction_non_alphanumeric': 0.05666622534092414, 'fraction_numerical': 0.015093340394545214, 'mean_word_length': 2.971608832807571, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '2909999', 'n_tokens_mistral': 2557, 'n_tokens_neox': 2348, 'n_words': 953}