mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-19 04:26:52 -04:00
drop more unused code, reduces size of exe by 20kb for msvc
This commit is contained in:
parent
d14661c3e8
commit
2def64bf19
@ -327,7 +327,6 @@
|
||||
<ClCompile Include="_ftpfr.c" />
|
||||
<ClCompile Include="_ftstroke.c" />
|
||||
<ClCompile Include="_ftsynth.c" />
|
||||
<ClCompile Include="_ftsystem.c" />
|
||||
<ClCompile Include="_fttype1.c" />
|
||||
<ClCompile Include="_pfr.c" />
|
||||
<ClCompile Include="_psaux.c" />
|
||||
|
@ -527,9 +527,6 @@
|
||||
<ClCompile Include="_ftsynth.c">
|
||||
<Filter>Source Files\Freetype</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="_ftsystem.c">
|
||||
<Filter>Source Files\Freetype</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="_fttype1.c">
|
||||
<Filter>Source Files\Freetype</Filter>
|
||||
</ClCompile>
|
||||
|
@ -558,6 +558,9 @@ static void LoadingScreen_Init(void* screen) {
|
||||
#define PROG_BAR_HEIGHT 4
|
||||
static void LoadingScreen_Render(void* screen, double delta) {
|
||||
struct LoadingScreen* s = screen;
|
||||
int progWidth;
|
||||
int x, y;
|
||||
|
||||
Gfx_SetTexturing(true);
|
||||
LoadingScreen_DrawBackground();
|
||||
|
||||
@ -565,9 +568,9 @@ static void LoadingScreen_Render(void* screen, double delta) {
|
||||
Elem_Render(&s->Message, delta);
|
||||
Gfx_SetTexturing(false);
|
||||
|
||||
int x = Gui_CalcPos(ANCHOR_CENTRE, 0, PROG_BAR_WIDTH, Game_Width);
|
||||
int y = Gui_CalcPos(ANCHOR_CENTRE, 34, PROG_BAR_HEIGHT, Game_Height);
|
||||
int progWidth = (int)(PROG_BAR_WIDTH * s->Progress);
|
||||
x = Gui_CalcPos(ANCHOR_CENTRE, 0, PROG_BAR_WIDTH, Game_Width);
|
||||
y = Gui_CalcPos(ANCHOR_CENTRE, 34, PROG_BAR_HEIGHT, Game_Height);
|
||||
progWidth = (int)(PROG_BAR_WIDTH * s->Progress);
|
||||
|
||||
PackedCol backCol = PACKEDCOL_CONST(128, 128, 128, 255);
|
||||
PackedCol progCol = PACKEDCOL_CONST(128, 255, 128, 255);
|
||||
|
@ -2343,10 +2343,11 @@ static void TextGroupWidget_Output(struct Portion bit, int lineBeg, int lineEnd,
|
||||
}
|
||||
|
||||
static int TextGroupWidget_Reduce(struct TextGroupWidget* w, char* chars, int target, struct Portion* portions) {
|
||||
struct Portion* start = portions;
|
||||
int total = 0, i;
|
||||
struct Portion* start = portions;
|
||||
int32_t begs[TEXTGROUPWIDGET_MAX_LINES];
|
||||
int32_t ends[TEXTGROUPWIDGET_MAX_LINES];
|
||||
struct Portion bit;
|
||||
int i, total = 0, end = 0;
|
||||
|
||||
for (i = 0; i < w->LinesCount; i++) {
|
||||
int lineLen = w->LineLengths[i];
|
||||
@ -2358,7 +2359,6 @@ static int TextGroupWidget_Reduce(struct TextGroupWidget* w, char* chars, int ta
|
||||
total += lineLen; ends[i] = total;
|
||||
}
|
||||
|
||||
int end = 0; struct Portion bit;
|
||||
for (;;) {
|
||||
int nextStart = TextGroupWidget_NextUrl(chars, total, end);
|
||||
|
||||
@ -2379,26 +2379,31 @@ static int TextGroupWidget_Reduce(struct TextGroupWidget* w, char* chars, int ta
|
||||
}
|
||||
|
||||
static void TextGroupWidget_FormatUrl(String* text, const String* url) {
|
||||
String_AppendColorless(text, url);
|
||||
char* dst;
|
||||
int i;
|
||||
char* dst = text->buffer;
|
||||
String_AppendColorless(text, url);
|
||||
|
||||
/* Delete "> " multiline chars from URLs */
|
||||
dst = text->buffer;
|
||||
for (i = text->length - 2; i >= 0; i--) {
|
||||
if (dst[i] != '>' || dst[i + 1] != ' ') continue;
|
||||
|
||||
String_DeleteAt(text, i + 1);
|
||||
String_DeleteAt(text, i);
|
||||
}
|
||||
}
|
||||
|
||||
static bool TextGroupWidget_GetUrl(struct TextGroupWidget* w, String* text, int index, int mouseX) {
|
||||
mouseX -= w->Textures[index].X;
|
||||
struct DrawTextArgs args = { 0 }; args.UseShadow = true;
|
||||
String line = TextGroupWidget_UNSAFE_Get(w, index);
|
||||
if (Game_ClassicMode) return false;
|
||||
|
||||
char chars[TEXTGROUPWIDGET_MAX_LINES * TEXTGROUPWIDGET_LEN];
|
||||
struct Portion portions[2 * (TEXTGROUPWIDGET_LEN / TEXTGROUPWIDGET_HTTP_LEN)];
|
||||
struct DrawTextArgs args = { 0 };
|
||||
String line;
|
||||
|
||||
mouseX -= w->Textures[index].X;
|
||||
args.UseShadow = true;
|
||||
line = TextGroupWidget_UNSAFE_Get(w, index);
|
||||
|
||||
if (Game_ClassicMode) return false;
|
||||
int i, x, portionsCount = TextGroupWidget_Reduce(w, chars, index, portions);
|
||||
|
||||
for (i = 0, x = 0; i < portionsCount; i++) {
|
||||
|
175
src/_ftsystem.c
175
src/_ftsystem.c
@ -1,175 +0,0 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* ftsystem.c */
|
||||
/* */
|
||||
/* ANSI-specific FreeType low-level system interface (body). */
|
||||
/* */
|
||||
/* Copyright 1996-2018 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
/* modified, and distributed under the terms of the FreeType project */
|
||||
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* This file contains the default interface used by FreeType to access */
|
||||
/* low-level, i.e. memory management, i/o access as well as thread */
|
||||
/* synchronisation. It can be replaced by user-specific routines if */
|
||||
/* necessary. */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#include "freetype/ft2build.h"
|
||||
#include FT_CONFIG_CONFIG_H_FT
|
||||
#include FT_INTERNAL_DEBUG_H_FT
|
||||
#include FT_INTERNAL_STREAM_H_FT
|
||||
#include FT_SYSTEM_H_FT
|
||||
#include FT_ERRORS_H_FT
|
||||
#include FT_TYPES_H_FT
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* RESOURCE MANAGEMENT INTERFACE */
|
||||
/* */
|
||||
/*************************************************************************/
|
||||
|
||||
#ifndef FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* The macro FT_COMPONENT is used in trace mode. It is an implicit */
|
||||
/* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
|
||||
/* messages during execution. */
|
||||
/* */
|
||||
#undef FT_COMPONENT
|
||||
#define FT_COMPONENT trace_io
|
||||
|
||||
/* We use the macro STREAM_FILE for convenience to extract the */
|
||||
/* system-specific stream handle from a given FreeType stream object */
|
||||
#define STREAM_FILE( stream ) ( (FT_FILE*)stream->descriptor.pointer )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* ft_ansi_stream_close */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* The function to close a stream. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* stream :: A pointer to the stream object. */
|
||||
/* */
|
||||
FT_CALLBACK_DEF( void )
|
||||
ft_ansi_stream_close( FT_Stream stream )
|
||||
{
|
||||
ft_fclose( STREAM_FILE( stream ) );
|
||||
|
||||
stream->descriptor.pointer = NULL;
|
||||
stream->size = 0;
|
||||
stream->base = NULL;
|
||||
}
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* ft_ansi_stream_io */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* The function to open a stream. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* stream :: A pointer to the stream object. */
|
||||
/* */
|
||||
/* offset :: The position in the data stream to start reading. */
|
||||
/* */
|
||||
/* buffer :: The address of buffer to store the read data. */
|
||||
/* */
|
||||
/* count :: The number of bytes to read from the stream. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* The number of bytes actually read. If `count' is zero (this is, */
|
||||
/* the function is used for seeking), a non-zero return value */
|
||||
/* indicates an error. */
|
||||
/* */
|
||||
FT_CALLBACK_DEF( unsigned long )
|
||||
ft_ansi_stream_io( FT_Stream stream,
|
||||
unsigned long offset,
|
||||
unsigned char* buffer,
|
||||
unsigned long count )
|
||||
{
|
||||
FT_FILE* file;
|
||||
|
||||
|
||||
if ( !count && offset > stream->size )
|
||||
return 1;
|
||||
|
||||
file = STREAM_FILE( stream );
|
||||
|
||||
if ( stream->pos != offset )
|
||||
ft_fseek( file, (long)offset, SEEK_SET );
|
||||
|
||||
return (unsigned long)ft_fread( buffer, 1, count, file );
|
||||
}
|
||||
|
||||
|
||||
/* documentation is in ftstream.h */
|
||||
|
||||
FT_BASE_DEF( FT_Error )
|
||||
FT_Stream_Open( FT_Stream stream,
|
||||
const char* filepathname )
|
||||
{
|
||||
FT_FILE* file;
|
||||
|
||||
|
||||
if ( !stream )
|
||||
return FT_THROW( Invalid_Stream_Handle );
|
||||
|
||||
stream->descriptor.pointer = NULL;
|
||||
stream->pathname.pointer = (char*)filepathname;
|
||||
stream->base = NULL;
|
||||
stream->pos = 0;
|
||||
stream->read = NULL;
|
||||
stream->close = NULL;
|
||||
|
||||
file = ft_fopen( filepathname, "rb" );
|
||||
if ( !file )
|
||||
{
|
||||
FT_ERROR(( "FT_Stream_Open:"
|
||||
" could not open `%s'\n", filepathname ));
|
||||
|
||||
return FT_THROW( Cannot_Open_Resource );
|
||||
}
|
||||
|
||||
ft_fseek( file, 0, SEEK_END );
|
||||
stream->size = (unsigned long)ft_ftell( file );
|
||||
if ( !stream->size )
|
||||
{
|
||||
FT_ERROR(( "FT_Stream_Open:" ));
|
||||
FT_ERROR(( " opened `%s' but zero-sized\n", filepathname ));
|
||||
ft_fclose( file );
|
||||
return FT_THROW( Cannot_Open_Stream );
|
||||
}
|
||||
ft_fseek( file, 0, SEEK_SET );
|
||||
|
||||
stream->descriptor.pointer = file;
|
||||
stream->read = ft_ansi_stream_io;
|
||||
stream->close = ft_ansi_stream_close;
|
||||
|
||||
FT_TRACE1(( "FT_Stream_Open:" ));
|
||||
FT_TRACE1(( " opened `%s' (%d bytes) successfully\n",
|
||||
filepathname, stream->size ));
|
||||
|
||||
return FT_Err_Ok;
|
||||
}
|
||||
|
||||
#endif /* !FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT */
|
||||
/* END */
|
@ -1,96 +0,0 @@
|
||||
FreeType font driver for PCF fonts
|
||||
|
||||
Francesco Zappa Nardelli
|
||||
<francesco.zappa.nardelli@ens.fr>
|
||||
|
||||
|
||||
Introduction
|
||||
************
|
||||
|
||||
PCF (Portable Compiled Format) is a binary bitmap font format, largely used
|
||||
in X world. This code implements a PCF driver for the FreeType library.
|
||||
Glyph images are loaded into memory only on demand, thus leading to a small
|
||||
memory footprint.
|
||||
|
||||
Information on the PCF font format can only be worked out from
|
||||
`pcfread.c', and `pcfwrite.c', to be found, for instance, in the XFree86
|
||||
(www.xfree86.org) source tree (xc/lib/font/bitmap/).
|
||||
|
||||
Many good bitmap fonts in bdf format come with XFree86: they can be
|
||||
compiled into the pcf format using the `bdftopcf' utility.
|
||||
|
||||
|
||||
Supported hardware
|
||||
******************
|
||||
|
||||
The driver has been tested on linux/x86 and sunos5.5/sparc. In both
|
||||
cases the compiler was gcc. When back in Paris, I will test it also
|
||||
on linux/alpha.
|
||||
|
||||
|
||||
Encodings
|
||||
*********
|
||||
|
||||
Use `FT_Get_BDF_Charset_ID' to access the encoding and registry.
|
||||
|
||||
The driver always exports `ft_encoding_none' as face->charmap.encoding.
|
||||
FT_Get_Char_Index() behavior is unmodified, that is, it converts the ULong
|
||||
value given as argument into the corresponding glyph number.
|
||||
|
||||
|
||||
Known problems
|
||||
**************
|
||||
|
||||
- dealing explicitly with encodings breaks the uniformity of FreeType 2
|
||||
API.
|
||||
|
||||
- except for encodings properties, client applications have no
|
||||
visibility of the PCF_Face object. This means that applications
|
||||
cannot directly access font tables and are obliged to trust
|
||||
FreeType.
|
||||
|
||||
- currently, glyph names and ink_metrics are ignored.
|
||||
|
||||
I plan to give full visibility of the PCF_Face object in the next
|
||||
release of the driver, thus implementing also glyph names and
|
||||
ink_metrics.
|
||||
|
||||
- height is defined as (ascent - descent). Is this correct?
|
||||
|
||||
- if unable to read size information from the font, PCF_Init_Face
|
||||
sets available_size->width and available_size->height to 12.
|
||||
|
||||
- too many english grammar errors in the readme file :-(
|
||||
|
||||
|
||||
License
|
||||
*******
|
||||
|
||||
Copyright (C) 2000 by Francesco Zappa Nardelli
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
Credits
|
||||
*******
|
||||
|
||||
Keith Packard wrote the pcf driver found in XFree86. His work is at
|
||||
the same time the specification and the sample implementation of the
|
||||
PCF format. Undoubtedly, this driver is inspired from his work.
|
@ -1,148 +0,0 @@
|
||||
FreeType font driver for BDF fonts
|
||||
|
||||
Francesco Zappa Nardelli
|
||||
<francesco.zappa.nardelli@ens.fr>
|
||||
|
||||
|
||||
Introduction
|
||||
************
|
||||
|
||||
BDF (Bitmap Distribution Format) is a bitmap font format defined by Adobe,
|
||||
which is intended to be easily understood by both humans and computers.
|
||||
This code implements a BDF driver for the FreeType library, following the
|
||||
Adobe Specification V 2.2. The specification of the BDF font format is
|
||||
available from Adobe's web site:
|
||||
|
||||
https://www.adobe.com/content/dam/acom/en/devnet/font/pdfs/5005.BDF_Spec.pdf
|
||||
|
||||
Many good bitmap fonts in bdf format come with XFree86 (www.XFree86.org).
|
||||
They do not define vertical metrics, because the X Consortium BDF
|
||||
specification has removed them.
|
||||
|
||||
|
||||
Encodings
|
||||
*********
|
||||
|
||||
The variety of encodings that accompanies bdf fonts appears to encompass the
|
||||
small set defined in freetype.h. On the other hand, two properties that
|
||||
specify encoding and registry are usually defined in bdf fonts.
|
||||
|
||||
I decided to make these two properties directly accessible, leaving to the
|
||||
client application the work of interpreting them. For instance:
|
||||
|
||||
|
||||
#include FT_INTERNAL_BDF_TYPES_H
|
||||
|
||||
FT_Face face;
|
||||
BDF_Public_Face bdfface;
|
||||
|
||||
|
||||
FT_New_Face( library, ..., &face );
|
||||
|
||||
bdfface = (BDF_Public_Face)face;
|
||||
|
||||
if ( ( bdfface->charset_registry == "ISO10646" ) &&
|
||||
( bdfface->charset_encoding == "1" ) )
|
||||
[..]
|
||||
|
||||
|
||||
Thus the driver always exports `ft_encoding_none' as face->charmap.encoding.
|
||||
FT_Get_Char_Index's behavior is unmodified, that is, it converts the ULong
|
||||
value given as argument into the corresponding glyph number.
|
||||
|
||||
If the two properties are not available, Adobe Standard Encoding should be
|
||||
assumed.
|
||||
|
||||
|
||||
Anti-Aliased Bitmaps
|
||||
********************
|
||||
|
||||
The driver supports an extension to the BDF format as used in Mark Leisher's
|
||||
xmbdfed bitmap font editor. Microsoft's SBIT tool expects bitmap fonts in
|
||||
that format for adding anti-aliased them to TrueType fonts. It introduces a
|
||||
fourth field to the `SIZE' keyword which gives the bpp value (bits per
|
||||
pixel) of the glyph data in the font. Possible values are 1 (the default),
|
||||
2 (four gray levels), 4 (16 gray levels), and 8 (256 gray levels). The
|
||||
driver returns either a bitmap with 1 bit per pixel or a pixmap with 8bits
|
||||
per pixel (using 4, 16, and 256 gray levels, respectively).
|
||||
|
||||
|
||||
Known problems
|
||||
**************
|
||||
|
||||
- A font is entirely loaded into memory. Obviously, this is not the Right
|
||||
Thing(TM). If you have big fonts I suggest you convert them into PCF
|
||||
format (using the bdftopcf utility): the PCF font drive of FreeType can
|
||||
perform incremental glyph loading.
|
||||
|
||||
When I have some time, I will implement on-demand glyph parsing.
|
||||
|
||||
- Except for encodings properties, client applications have no visibility of
|
||||
the PCF_Face object. This means that applications cannot directly access
|
||||
font tables and must trust FreeType.
|
||||
|
||||
- Currently, glyph names are ignored.
|
||||
|
||||
I plan to give full visibility of the BDF_Face object in an upcoming
|
||||
revision of the driver, thus implementing also glyph names.
|
||||
|
||||
- As I have never seen a BDF font that defines vertical metrics, vertical
|
||||
metrics are (parsed and) discarded. If you own a BDF font that defines
|
||||
vertical metrics, please let me know (I will implement them in 5-10
|
||||
minutes).
|
||||
|
||||
|
||||
License
|
||||
*******
|
||||
|
||||
Copyright (C) 2001-2002 by Francesco Zappa Nardelli
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
*** Portions of the driver (that is, bdflib.c and bdf.h):
|
||||
|
||||
Copyright 2000 Computing Research Labs, New Mexico State University
|
||||
Copyright 2001-2002, 2011 Francesco Zappa Nardelli
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the "Software"),
|
||||
to deal in the Software without restriction, including without limitation
|
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
and/or sell copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
|
||||
OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
|
||||
THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
|
||||
Credits
|
||||
*******
|
||||
|
||||
This driver is based on excellent Mark Leisher's bdf library. If you
|
||||
find something good in this driver you should probably thank him, not
|
||||
me.
|
@ -1,39 +0,0 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* afblue.c */
|
||||
/* */
|
||||
/* Auto-fitter data for blue strings (body). */
|
||||
/* */
|
||||
/* Copyright 2013-2018 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
/* modified, and distributed under the terms of the FreeType project */
|
||||
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#include "aftypes.h"
|
||||
|
||||
|
||||
FT_LOCAL_ARRAY_DEF( char )
|
||||
af_blue_strings[] =
|
||||
{
|
||||
/* */
|
||||
@AF_BLUE_STRINGS_ARRAY@
|
||||
};
|
||||
|
||||
|
||||
/* stringsets are specific to styles */
|
||||
FT_LOCAL_ARRAY_DEF( AF_Blue_StringRec )
|
||||
af_blue_stringsets[] =
|
||||
{
|
||||
/* */
|
||||
@AF_BLUE_STRINGSETS_ARRAY@
|
||||
};
|
||||
|
||||
|
||||
/* END */
|
File diff suppressed because it is too large
Load Diff
@ -1,146 +0,0 @@
|
||||
/***************************************************************************/
|
||||
/* */
|
||||
/* afblue.h */
|
||||
/* */
|
||||
/* Auto-fitter data for blue strings (specification). */
|
||||
/* */
|
||||
/* Copyright 2013-2018 by */
|
||||
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
|
||||
/* */
|
||||
/* This file is part of the FreeType project, and may only be used, */
|
||||
/* modified, and distributed under the terms of the FreeType project */
|
||||
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
|
||||
/* this file you indicate that you have read the license and */
|
||||
/* understand and accept it fully. */
|
||||
/* */
|
||||
/***************************************************************************/
|
||||
|
||||
|
||||
#ifndef AFBLUE_H_
|
||||
#define AFBLUE_H_
|
||||
|
||||
|
||||
FT_BEGIN_HEADER
|
||||
|
||||
|
||||
/* an auxiliary macro to decode a UTF-8 character -- since we only use */
|
||||
/* hard-coded, self-converted data, no error checking is performed */
|
||||
#define GET_UTF8_CHAR( ch, p ) \
|
||||
do \
|
||||
{ \
|
||||
ch = (unsigned char)*p++; \
|
||||
if ( ch >= 0x80 ) \
|
||||
{ \
|
||||
FT_UInt len_; \
|
||||
\
|
||||
\
|
||||
if ( ch < 0xE0 ) \
|
||||
{ \
|
||||
len_ = 1; \
|
||||
ch &= 0x1F; \
|
||||
} \
|
||||
else if ( ch < 0xF0 ) \
|
||||
{ \
|
||||
len_ = 2; \
|
||||
ch &= 0x0F; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
len_ = 3; \
|
||||
ch &= 0x07; \
|
||||
} \
|
||||
\
|
||||
for ( ; len_ > 0; len_-- ) \
|
||||
ch = ( ch << 6 ) | ( *p++ & 0x3F ); \
|
||||
} \
|
||||
} while ( 0 )
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** B L U E S T R I N G S *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/* At the bottommost level, we define strings for finding blue zones. */
|
||||
|
||||
|
||||
#define AF_BLUE_STRING_MAX_LEN @AF_BLUE_STRING_MAX_LEN@
|
||||
|
||||
/* The AF_Blue_String enumeration values are offsets into the */
|
||||
/* `af_blue_strings' array. */
|
||||
|
||||
typedef enum AF_Blue_String_
|
||||
{
|
||||
@AF_BLUE_STRING_ENUM@
|
||||
|
||||
AF_BLUE_STRING_MAX /* do not remove */
|
||||
|
||||
} AF_Blue_String;
|
||||
|
||||
|
||||
FT_LOCAL_ARRAY( char )
|
||||
af_blue_strings[];
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
/***** B L U E S T R I N G S E T S *****/
|
||||
/***** *****/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
/* The next level is to group blue strings into style-specific sets. */
|
||||
|
||||
|
||||
/* Properties are specific to a writing system. We assume that a given */
|
||||
/* blue string can't be used in more than a single writing system, which */
|
||||
/* is a safe bet. */
|
||||
#define AF_BLUE_PROPERTY_LATIN_TOP ( 1U << 0 ) /* must have value 1 */
|
||||
#define AF_BLUE_PROPERTY_LATIN_SUB_TOP ( 1U << 1 )
|
||||
#define AF_BLUE_PROPERTY_LATIN_NEUTRAL ( 1U << 2 )
|
||||
#define AF_BLUE_PROPERTY_LATIN_X_HEIGHT ( 1U << 3 )
|
||||
#define AF_BLUE_PROPERTY_LATIN_LONG ( 1U << 4 )
|
||||
|
||||
#define AF_BLUE_PROPERTY_CJK_TOP ( 1U << 0 ) /* must have value 1 */
|
||||
#define AF_BLUE_PROPERTY_CJK_HORIZ ( 1U << 1 ) /* must have value 2 */
|
||||
#define AF_BLUE_PROPERTY_CJK_RIGHT AF_BLUE_PROPERTY_CJK_TOP
|
||||
|
||||
|
||||
#define AF_BLUE_STRINGSET_MAX_LEN @AF_BLUE_STRINGSET_MAX_LEN@
|
||||
|
||||
/* The AF_Blue_Stringset enumeration values are offsets into the */
|
||||
/* `af_blue_stringsets' array. */
|
||||
|
||||
typedef enum AF_Blue_Stringset_
|
||||
{
|
||||
@AF_BLUE_STRINGSET_ENUM@
|
||||
|
||||
AF_BLUE_STRINGSET_MAX /* do not remove */
|
||||
|
||||
} AF_Blue_Stringset;
|
||||
|
||||
|
||||
typedef struct AF_Blue_StringRec_
|
||||
{
|
||||
AF_Blue_String string;
|
||||
FT_UShort properties;
|
||||
|
||||
} AF_Blue_StringRec;
|
||||
|
||||
|
||||
FT_LOCAL_ARRAY( AF_Blue_StringRec )
|
||||
af_blue_stringsets[];
|
||||
|
||||
/* */
|
||||
|
||||
FT_END_HEADER
|
||||
|
||||
|
||||
#endif /* AFBLUE_H_ */
|
||||
|
||||
|
||||
/* END */
|
@ -1984,15 +1984,6 @@ FT_BEGIN_HEADER
|
||||
#define FT_OPEN_PARAMS 0x10
|
||||
|
||||
|
||||
/* these constants are deprecated; use the corresponding `FT_OPEN_XXX' */
|
||||
/* values instead */
|
||||
#define ft_open_memory FT_OPEN_MEMORY
|
||||
#define ft_open_stream FT_OPEN_STREAM
|
||||
#define ft_open_pathname FT_OPEN_PATHNAME
|
||||
#define ft_open_driver FT_OPEN_DRIVER
|
||||
#define ft_open_params FT_OPEN_PARAMS
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Struct> */
|
||||
@ -2272,28 +2263,6 @@ FT_BEGIN_HEADER
|
||||
FT_Face *aface );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
/* FT_Attach_File */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Call @FT_Attach_Stream to attach a file. */
|
||||
/* */
|
||||
/* <InOut> */
|
||||
/* face :: The target face object. */
|
||||
/* */
|
||||
/* <Input> */
|
||||
/* filepathname :: The pathname. */
|
||||
/* */
|
||||
/* <Return> */
|
||||
/* FreeType error code. 0~means success. */
|
||||
/* */
|
||||
FT_EXPORT( FT_Error )
|
||||
FT_Attach_File( FT_Face face,
|
||||
const char* filepathname );
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
|
@ -203,13 +203,6 @@
|
||||
}
|
||||
|
||||
#ifndef FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT
|
||||
|
||||
else if ( args->flags & FT_OPEN_PATHNAME )
|
||||
{
|
||||
/* create a normal system stream */
|
||||
error = FT_Stream_Open( stream, args->pathname );
|
||||
stream->pathname.pointer = args->pathname;
|
||||
}
|
||||
else if ( ( args->flags & FT_OPEN_STREAM ) && args->stream )
|
||||
{
|
||||
/* use an existing, user-provided stream */
|
||||
@ -1664,28 +1657,6 @@
|
||||
}
|
||||
|
||||
|
||||
/* documentation is in freetype.h */
|
||||
|
||||
FT_EXPORT_DEF( FT_Error )
|
||||
FT_Attach_File( FT_Face face,
|
||||
const char* filepathname )
|
||||
{
|
||||
FT_Open_Args open;
|
||||
|
||||
|
||||
/* test for valid `face' delayed to `FT_Attach_Stream' */
|
||||
|
||||
if ( !filepathname )
|
||||
return FT_THROW( Invalid_Argument );
|
||||
|
||||
open.stream = NULL;
|
||||
open.flags = FT_OPEN_PATHNAME;
|
||||
open.pathname = (char*)filepathname;
|
||||
|
||||
return FT_Attach_Stream( face, &open );
|
||||
}
|
||||
|
||||
|
||||
/* documentation is in freetype.h */
|
||||
|
||||
FT_EXPORT_DEF( FT_Error )
|
||||
|
@ -87,28 +87,9 @@
|
||||
#define ft_strcpy strcpy
|
||||
#define ft_strlen strlen
|
||||
#define ft_strncmp strncmp
|
||||
#define ft_strncpy strncpy
|
||||
#define ft_strrchr strrchr
|
||||
#define ft_strstr strstr
|
||||
|
||||
|
||||
/**********************************************************************/
|
||||
/* */
|
||||
/* file handling */
|
||||
/* */
|
||||
/**********************************************************************/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#define FT_FILE FILE
|
||||
#define ft_fclose fclose
|
||||
#define ft_fopen fopen
|
||||
#define ft_fread fread
|
||||
#define ft_fseek fseek
|
||||
#define ft_ftell ftell
|
||||
|
||||
|
||||
/**********************************************************************/
|
||||
/* */
|
||||
/* sorting */
|
||||
|
@ -318,16 +318,6 @@ FT_BEGIN_HEADER
|
||||
#define FT_READ_ULONG_LE( var ) FT_READ_MACRO( FT_Stream_ReadULongLE, FT_ULong, var )
|
||||
|
||||
|
||||
#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM
|
||||
|
||||
/* initialize a stream for reading a regular system stream */
|
||||
FT_BASE( FT_Error )
|
||||
FT_Stream_Open( FT_Stream stream,
|
||||
const char* filepathname );
|
||||
|
||||
#endif /* FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM */
|
||||
|
||||
|
||||
/* create a new (input) stream from an FT_Open_Args structure */
|
||||
FT_BASE( FT_Error )
|
||||
FT_Stream_New( FT_Library library,
|
||||
|
Loading…
x
Reference in New Issue
Block a user