<commit_before>/* QuesoGLC
 * A free implementation of the OpenGL Character Renderer (GLC)
 * Copyright (c) 2002-2005, <NAME>
 *
 *  This 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.
 *
 *  This 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 this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
/* $Id$ */

/* \file
 * defines the so-called "Measurement commands" described in chapter 3.10 of
 * the GLC specs.
 */

/** \defgroup measure Measurement commands
 *  Those commands returns metrics (bounding box, baseline) of character or
 *  string layouts. Glyphs coordinates are defined in <em>em units</em> and are
 *  transformed during rendering to produce the desired mapping of the glyph
 *  shape into the GL window coordinate system. Moreover, GLC can return some
 *  metrics for a character and string layouts. The table below lists the
 *  metrics that are available :
 *  <center>
 *  <table>
 *  <caption>Metrics for character and string layout</caption>
 *    <tr>
 *      <td>Name</td> <td>Enumerant</td> <td>Vector</td>
 *    </tr>
 *    <tr>
 *      <td><b>GLC_BASELINE</b></td> <td>0x0030</td>
 *      <td>[ x<sub>l</sub> y<sub>l</sub> x<sub>r</sub> y<sub>r</sub> ]</td>
 *    </tr>
 *    <tr>
 *     <td><b>GLC_BOUNDS</b></td> <td>0x0031</td>
 *     <td>[ x<sub>lb</sub> y<sub>lb</sub> x<sub>rb</sub> y<sub>rb</sub>
 *           x<sub>rt</sub> y<sub>rt</sub> x<sub>lt</sub> y<sub>lt</sub> ]</td>
 *    </tr>
 *  </table>
 *  </center>
 *  \n \b GLC_BASELINE is the line segment from the origin of the layout to the
 *  origin of the following layout. \b GLC_BOUNDS is the bounding box of the
 *  layout.
 *  \image html measure.png
 *  \n Each point <em>(x,y)</em> is computed in em coordinates, with the origin
 *  of a layout at <em>(0,0)</em>. If the value of the variable
 *  \b GLC_RENDER_STYLE is \b GLC_BITMAP, each point is transformed by the 2x2
 *  \b GLC_BITMAP_MATRIX.
 */

#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <fontconfig/fontconfig.h>
#include <fontconfig/fcfreetype.h>

#include "GL/glc.h"
#include "internal.h"
#include FT_GLYPH_H



/* Multiply a vector by the GLC_BITMAP_MATRIX */
static void __glcTransformVector(GLfloat* outVec, __glcContextState *inState)
{
  GLfloat* matrix = inState->bitmapMatrix;
  GLfloat temp = 0.f;

  temp = matrix[0] * outVec[0] + matrix[2] * outVec[1];<commit_msg>- The management of the header file assert.h has been moved in internal.h<commit_after>/* QuesoGLC
 * A free implementation of the OpenGL Character Renderer (GLC)
 * Copyright (c) 2002-2005, <NAME>
 *
 *  This 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.
 *
 *  This 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 this library; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
/* $Id$ */

/* \file
 * defines the so-called "Measurement commands" described in chapter 3.10 of
 * the GLC specs.
 */

/** \defgroup measure Measurement commands
 *  Those commands returns metrics (bounding box, baseline) of character or
 *  string layouts. Glyphs coordinates are defined in <em>em units</em> and are
 *  transformed during rendering to produce the desired mapping of the glyph
 *  shape into the GL window coordinate system. Moreover, GLC can return some
 *  metrics for a character and string layouts. The table below lists the
 *  metrics that are available :
 *  <center>
 *  <table>
 *  <caption>Metrics for character and string layout</caption>
 *    <tr>
 *      <td>Name</td> <td>Enumerant</td> <td>Vector</td>
 *    </tr>
 *    <tr>
 *      <td><b>GLC_BASELINE</b></td> <td>0x0030</td>
 *      <td>[ x<sub>l</sub> y<sub>l</sub> x<sub>r</sub> y<sub>r</sub> ]</td>
 *    </tr>
 *    <tr>
 *     <td><b>GLC_BOUNDS</b></td> <td>0x0031</td>
 *     <td>[ x<sub>lb</sub> y<sub>lb</sub> x<sub>rb</sub> y<sub>rb</sub>
 *           x<sub>rt</sub> y<sub>rt</sub> x<sub>lt</sub> y<sub>lt</sub> ]</td>
 *    </tr>
 *  </table>
 *  </center>
 *  \n \b GLC_BASELINE is the line segment from the origin of the layout to the
 *  origin of the following layout. \b GLC_BOUNDS is the bounding box of the
 *  layout.
 *  \image html measure.png
 *  \n Each point <em>(x,y)</em> is computed in em coordinates, with the origin
 *  of a layout at <em>(0,0)</em>. If the value of the variable
 *  \b GLC_RENDER_STYLE is \b GLC_BITMAP, each point is transformed by the 2x2
 *  \b GLC_BITMAP_MATRIX.
 */

#include <string.h>
#include <stdlib.h>
#include <fontconfig/fontconfig.h>
#include <fontconfig/fcfreetype.h>

#include "GL/glc.h"
#include "internal.h"
#include FT_GLYPH_H



/* Multiply a vector by the GLC_BITMAP_MATRIX */
static void __glcTransformVector(GLfloat* outVec, __glcContextState *inState)
{
  GLfloat* matrix = inState->bitmapMatrix;
  GLfloat temp = 0.f;

  temp = matrix[0] * outVec[0] + matrix[2] * outVec[1];
{'fraction_non_alphanumeric': 0.12225969645868466, 'fraction_numerical': 0.01551433389544688, 'mean_word_length': 3.4829931972789114, 'pattern_counts': {'":': 0, '<': 142, '<?xml version=': 0, '>': 144, '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': '5165265', 'n_tokens_mistral': 2049, 'n_tokens_neox': 1975, 'n_words': 723}