Skip to content

Commit

Permalink
Major update to introduce a working Document class (#220)
Browse files Browse the repository at this point in the history
* [Build] MSVC builds now turn off exception handling when in release mode.
* [Build] Address analysis on Linux now disables audio and forces the need for a static build
* [Build] Fixed issue with the Core module referencing libs that might be disabled

* [Core] Aligned BaseClass to 64-bit for Linux builds; The BaseClass' Owner pointer will now be cleared if an object is locked at the time of termination
* [Core] Changed the BaseClass OwnerID field to a direct Owner pointer
* [Core] Changed the ERR type values from standard C to strongly typed C++
* [Core] Corrected bug in the calculation of the Time class' Timestamp field
* [Core] Fixed bug in pf::vector erase() functionality
* [Core] Minor optimisations made to the setFields() method and object::Create()
* [Core] Renamed JET type CROSSED_INTO to CROSSED_IN; JTYPE FEEDBACK type to CROSSING; JET ENTERED_AREA to CROSSED_INTO and LEFT_AREA to CROSSED_OUT
* [Core] Refactored higher tier log messaging
* [Core] Significantly shrunk the DateTime structure by using smaller types

* [Document] Introduced the Document class

* [Fluid] Fixed buffer overflow issue when reporting errors
* [Fluid] Reading a field from a terminated object will no longer cause a segfault
* [Fluid] String fields marked with ALLOC are now terminated correctly.

* [Font] Moved the freetype library to the 3rdparty folder; Upgraded freetype-2.10.2 to freetype-2.13.2
* [Font] Refreshed the pre-installed truetype fonts in order to support variable font parameters
* [Font] Added RefreshFonts() as a public API function; Added support for font family aliases
* [Font] Added support for meta information when querying fonts; It is now possible to define hinting preferences in the font database
* [Font] Removed Angle field; Changed GlyphSpacing field to a multiplier
* [Font] Removed ConvertCoords(), SetDefaultSize(), StringSize(), InstallFont(), RemoveFont()
* [Font] Removed truetype support from the Font class as it is now supported by the Vector API
* [Font] Simplified font resolution; Added ResolveFamilyName()
* [Font] The GetFontList() function now returns an Axes string for variable fonts
* [Font] Variable font axes information is now written to the fonts.cfg file

* [Picture] Removed resizing functionality from the Picture class

* [SVG] Added a guard against duplicated IDs when in the scope of a <use> or <symbol> element
* [SVG] Added support for 'mask' and 'clip-path', 'xOffset' and 'yOffset' attributes to the <svg> element
* [SVG] Altered the <use> element code to more accurately follow W3C guidelines
* [SVG] Fixed animation bugs
* [SVG] Fixed issue with the inheritance of opacity values.
* [SVG] Improved <mask> and <image> parsing
* [SVG] Improved Target field support, reduces the creation of a second viewport when a VectorScene is targeted.
* [SVG] Improved metric parsing
* [SVG] Modified clip-path support to ensure that a clip-path can only be created once
* [SVG] Improved support for currentColor

* [Scripts] Added missing alias name check for font dialog.
* [Scripts] Changed existing scripts to use vector typeset functionaliity
* [Scripts] Fixed an IDL bug affecting char based lookups
* [Scripts] Fixed remaining Font Dialog issues

* [UI] Allow SECONDARY button click events to be sent to input receivers.
* [UI] Cleaned up the dialog script; Improved Dialog window sizing control
* [UI] Removed unnecessary fill instructions from SVG icon files
* [UI] Stale clipboard files are now removed automatically
* [UI] Added radial, spiral, screen-wipe FX

* [Vector] Fixed clipping bug in mask rendering
* [Vector] Improved support for variable font metrics and caching
* [Vector] Added DisplaySize and LineSpacing fields to VectorText; Addressed some DPI issues in rendering and metrics management
* [Vector] Added Point field to VectorText
* [Vector] Added TClipRectangle
* [Vector] Added a glyph caching system to speed up VectorText
* [Vector] Added correct scaling support to rounded rectangle path generation.
* [Vector] Added extensive support for clipping paths and masked paths
* [Vector] Added support for client-defined clip masks to the Viewport class.
* [Vector] Added support for preserveAspectRatio
* [Vector] Added support for stroked clip masks
* [Vector] Added vecGetFontHandle(), vecGetFontMetrics(), vecStringWidth(), vecCharWidth(), vecFlushMatrix()
* [Vector] Changed rounded rectangle's path computation to use standard arc commands for path building
* [Vector] Corrected clip mask positioning issues in ClipBuffer::draw_userspace()
* [Vector] Corrected the application of stroke values in calc_full_boundary(); Removed redundant ClipMask boundary code
* [Vector] Custom path generation now takes the scale of parent viewports into consideration
* [Vector] Deprecated redundant scanline class from AGG
* [Vector] Elliptical path generation now takes the scale of parent viewports into consideration
* [Vector] Enhanced clip-mask support for all fill operations
* [Vector] Fixed VectorViewport's support for custom clip paths.
* [Vector] Fixed clipping boundary issue in cases where a clipping zone axis is inversed
* [Vector] Fixed crash caused by set_clip_region() returning ERR_Okay in the event of a clipping problem.
* [Vector] Fixed crashes caused when a ClosePath command is followed by any command declaring a relative position.
* [Vector] Fixed dimension setting issues with Viewports that reference fill patterns
* [Vector] Fixed incorrect setting of the PageHeight when in RESIZE mode.
* [Vector] Fixed issue with clip-paths ignoring the viewbox X,Y values
* [Vector] Fixed issue with the Vector's Filter field not supporting HostScene redirection
* [Vector] Fixed outstanding issues with BlurFX <feGaussianBlur> support
* [Vector] Font objects are now cached globally rather than once-per-VectorText
* [Vector] Gaussian Blur effect will scale if in bounding-box mode
* [Vector] Gradient fills now support masks.
* [Vector] Implemented local freetype support in VectorText
* [Vector] Improved the VectorSpiral class so that path generation can be more effectively controlled.
* [Vector] Improved userspace support for clipping paths.
* [Vector] Merged generate_clip() with calc_full_boundary(); strokes can now be taken into account when calculating boundaries.
* [Vector] Modified VectorFilter get_source_bitmap() to explicitly copy the source graphic's clipping region.
* [Vector] Mouse wheel events will now "bubble-up" if not consumed by the first vector to receive the event
* [Vector] Overhauled the base Vector's bounds management with TClipRectangle
* [Vector] Path generation for VectorText will now always compute the Transform matrix because the FinalX/Y values need to be accounted for.
* [Vector] Raised the minimum stroke size from 100 to 2000 pixels
* [Vector] Removed Transform field from VectorClip; Improved VectorClip memory management
* [Vector] Removed calls to approximation_scale() from path generators and applied to the scene graph renderer instead.
* [Vector] Removed mTransform and mApplyTransform state management in favour of applying a transform matrix directly to VectorPattern
* [Vector] Reworked clipping to use stacked bitmap buffers
* [Vector] Rewrote ClipBuffer::draw_userspace() to match the VectorPattern's drawing method
* [Vector] Simplified clipping routines further; Fixed VFX issues that had been inadvertently introduced
* [Vector] The SceneRenderer is now allocated dynamically and no longer stored in the VectorScene.
* [Vector] The VectorClip is no longer a member of the Vector class
* [Vector] The mouse cursor state will now be refreshed whenever vector paths are updated.
* [Vector] VectorFilter now supports an AspectRatio field
* [Vector] VectorGroup now resets its dirty marker when refreshed
* [Vector] VectorGroups now support bounding-box clip paths
* [Vector] VectorPolygon now supports scaled values for X1,Y1,X2,Y2
* [Vector] VectorScene input handler now ignores events that are received for other surfaces.
* [Vector] Vectors that define clip-masks now declare boundaries that include the clip-mask and the vector path, whichever is smallest.
* [Vector] When retrieving a viewport's width and height, preference is now given to returning the vpViewWidth and vpViewHeight viewbox values if they are defined.

* [AGG] Disabled pod_allocator
* [AGG] Removed agg_font_cache_manager.h; agg_trans_double_path class; redundant glyph files; agg::pod_vector from the blur filter; agg_blur.h
* [AGG] agg_rasterizer_cells: No longer requires a destructor; Reduced use of the custom pod_vector class; Changed m_cells field to a std::vector

* [Win32] Clicking in the non-client area of a window will now be registered as a secondary input event.
* [Win32] Movement in the non-client area of a window will now be registered as a secondary input event.

* [X11] Improved X11 synchronisation on program closure.
* [X11] Switched to using pixmap buffers for X11 window graphics.
  • Loading branch information
paul-manias authored Mar 31, 2024
1 parent 22a120b commit 0992e34
Show file tree
Hide file tree
Showing 1,727 changed files with 126,382 additions and 62,914 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,9 @@ src/fluid/luajit-2.0.5/src/host/minilua
src/fluid/luajit-2.0.5/src/jit/vmdef.lua
release-git/
src/display/simd/
data/fonts/truetype/NotoColorEmoji.ttf
build/
debug-gdb/
debug-mod/
local-mod/
local-gdb/
245 changes: 245 additions & 0 deletions 3rdparty/freetype-2.13.2/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,245 @@
# Copyright (C) 2013-2023 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# Written originally by John Cary <cary@txcorp.com>
#
# 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(CheckIncludeFile)

#-DFT_DEBUG_LEVEL_ERROR -DFT_DEBUG_LEVEL_TRACE

option(FT_DISABLE_BZIP2 "" ON)
option(FT_DISABLE_BROTLI "" ON)
option(FT_ENABLE_ERROR_STRINGS "" OFF)
option(FT_CONFIG_OPTION_USE_LZW "" OFF)
option(FT_CONFIG_OPTION_MAC_FONTS "" OFF)
option(FT_CONFIG_OPTION_INCREMENTAL "" OFF)
option(TT_CONFIG_OPTION_BDF "" OFF)
option(FT_CONFIG_OPTION_USE_ZLIB "" OFF)
option(TT_CONFIG_OPTION_GX_VAR_SUPPORT "" OFF)

# CMAKE_TOOLCHAIN_FILE must be set before `project' is called, which
# configures the base build environment and references the toolchain file
if (APPLE)
if (DEFINED IOS_PLATFORM)
if (NOT "${IOS_PLATFORM}" STREQUAL "OS"
AND NOT "${IOS_PLATFORM}" STREQUAL "SIMULATOR"
AND NOT "${IOS_PLATFORM}" STREQUAL "SIMULATOR64")
message(FATAL_ERROR
"IOS_PLATFORM must be set to either OS, SIMULATOR, or SIMULATOR64")
endif ()
if (NOT "${CMAKE_GENERATOR}" STREQUAL "Xcode")
message(AUTHOR_WARNING
"You should use Xcode generator with IOS_PLATFORM enabled to get Universal builds.")
endif ()
if (BUILD_SHARED_LIBS)
message(FATAL_ERROR
"BUILD_SHARED_LIBS can not be on with IOS_PLATFORM enabled")
endif ()
if (BUILD_FRAMEWORK)
message(FATAL_ERROR
"BUILD_FRAMEWORK can not be on with IOS_PLATFORM enabled")
endif ()

# iOS only uses static libraries
set(BUILD_SHARED_LIBS OFF)

set(CMAKE_TOOLCHAIN_FILE
${CMAKE_SOURCE_DIR}/builds/cmake/iOS.cmake)
endif ()
else ()
if (DEFINED IOS_PLATFORM)
message(FATAL_ERROR "IOS_PLATFORM is not supported on this platform")
endif ()
endif ()

project(freetype C)

set(VERSION_MAJOR "2")
set(VERSION_MINOR "13")
set(VERSION_PATCH "2")

# Generate LIBRARY_VERSION and LIBRARY_SOVERSION.
set(LIBTOOL_REGEX "version_info='([0-9]+):([0-9]+):([0-9]+)'")

file(STRINGS "${PROJECT_SOURCE_DIR}/builds/unix/configure.raw" VERSION_INFO REGEX ${LIBTOOL_REGEX})

string(REGEX REPLACE ${LIBTOOL_REGEX} "\\1" LIBTOOL_CURRENT "${VERSION_INFO}")
string(REGEX REPLACE ${LIBTOOL_REGEX} "\\2" LIBTOOL_REVISION "${VERSION_INFO}")
string(REGEX REPLACE ${LIBTOOL_REGEX} "\\3" LIBTOOL_AGE "${VERSION_INFO}")

# This is what libtool does internally on Unix platforms.
math(EXPR LIBRARY_SOVERSION "${LIBTOOL_CURRENT} - ${LIBTOOL_AGE}")
set(LIBRARY_VERSION "${LIBRARY_SOVERSION}.${LIBTOOL_AGE}.${LIBTOOL_REVISION}")

option(FT_ENABLE_ERROR_STRINGS "Enable support for meaningful error descriptions." OFF)

# Add local cmake modules
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/builds/cmake)

# Create the configuration file
if (UNIX)
check_include_file("unistd.h" HAVE_UNISTD_H)
check_include_file("fcntl.h" HAVE_FCNTL_H)

file(READ "${PROJECT_SOURCE_DIR}/builds/unix/ftconfig.h.in"
FTCONFIG_H)
if (HAVE_UNISTD_H)
string(REGEX REPLACE
"#undef +(HAVE_UNISTD_H)" "#define \\1 1"
FTCONFIG_H "${FTCONFIG_H}")
endif ()
if (HAVE_FCNTL_H)
string(REGEX REPLACE
"#undef +(HAVE_FCNTL_H)" "#define \\1 1"
FTCONFIG_H "${FTCONFIG_H}")
endif ()
else ()
file(READ "${PROJECT_SOURCE_DIR}/include/freetype/config/ftconfig.h"
FTCONFIG_H)
endif ()

set(FTCONFIG_H_NAME "${PROJECT_BINARY_DIR}/include/freetype/config/ftconfig.h")
if (EXISTS "${FTCONFIG_H_NAME}")
file(READ "${FTCONFIG_H_NAME}" ORIGINAL_FTCONFIG_H)
else ()
set(ORIGINAL_FTCONFIG_H "")
endif ()
if (NOT (ORIGINAL_FTCONFIG_H STREQUAL FTCONFIG_H))
file(WRITE "${FTCONFIG_H_NAME}" "${FTCONFIG_H}")
endif ()

# Create the options file
file(READ "${PROJECT_SOURCE_DIR}/include/freetype/config/ftoption.h" FTOPTION_H)

if (FT_ENABLE_ERROR_STRINGS)
string(REGEX REPLACE "/\\* +(#define +FT_CONFIG_OPTION_ERROR_STRINGS) +\\*/" "\\1"
FTOPTION_H "${FTOPTION_H}")
endif ()

set(FTOPTION_H_NAME "${PROJECT_BINARY_DIR}/include/freetype/config/ftoption.h")
if (EXISTS "${FTOPTION_H_NAME}")
file(READ "${FTOPTION_H_NAME}" ORIGINAL_FTOPTION_H)
else ()
set(ORIGINAL_FTOPTION_H "")
endif ()
if (NOT (ORIGINAL_FTOPTION_H STREQUAL FTOPTION_H))
file(WRITE "${FTOPTION_H_NAME}" "${FTOPTION_H}")
endif ()

file(GLOB PUBLIC_HEADERS "include/ft2build.h" "include/freetype/*.h")
file(GLOB PUBLIC_CONFIG_HEADERS "include/freetype/config/*.h")
file(GLOB PRIVATE_HEADERS "include/freetype/internal/*.h")

set(BASE_SRCS
src/autofit/autofit.c
src/base/ftbase.c
# src/base/ftbbox.c
# src/base/ftbdf.c
src/base/ftbitmap.c
# src/base/ftcid.c
# src/base/ftfstype.c
# src/base/ftgasp.c
src/base/ftglyph.c
# src/base/ftgxval.c
src/base/ftinit.c
src/base/ftmm.c
# src/base/ftotval.c
src/base/ftpatent.c
# src/base/ftpfr.c
src/base/ftstroke.c
# src/base/ftsynth.c
src/base/fttype1.c
# src/base/ftwinfnt.c
# src/bdf/bdf.c
# src/bzip2/ftbzip2.c
src/cache/ftcache.c
src/cff/cff.c
# src/cid/type1cid.c
# src/gzip/ftgzip.c
# src/lzw/ftlzw.c
# src/pcf/pcf.c
# src/pfr/pfr.c
# src/psaux/psaux.c
src/pshinter/pshinter.c
src/psnames/psnames.c
src/raster/raster.c
# src/sdf/sdf.c
src/sfnt/sfnt.c
src/smooth/smooth.c
# src/svg/svg.c
src/truetype/truetype.c
# src/type1/type1.c
# src/type42/type42.c
# src/winfonts/winfnt.c
)

if (UNIX)
list(APPEND BASE_SRCS "builds/unix/ftsystem.c")
elseif (WIN32)
list(APPEND BASE_SRCS "builds/windows/ftsystem.c")
else ()
list(APPEND BASE_SRCS "src/base/ftsystem.c")
endif ()

if (WIN32)
enable_language(RC)
list(APPEND BASE_SRCS builds/windows/ftdebug.c src/base/ftver.rc)
elseif (WINCE)
list(APPEND BASE_SRCS builds/wince/ftdebug.c)
else ()
list(APPEND BASE_SRCS src/base/ftdebug.c)
endif ()

if (NOT DISABLE_FORCE_DEBUG_POSTFIX)
set(CMAKE_DEBUG_POSTFIX d)
endif ()

add_library(freetype
${PUBLIC_HEADERS}
${PUBLIC_CONFIG_HEADERS}
${PRIVATE_HEADERS}
${BASE_SRCS}
)

set_target_properties(freetype PROPERTIES C_VISIBILITY_PRESET hidden)

target_compile_definitions(freetype PRIVATE FT2_BUILD_LIBRARY)

if (WIN32)
target_compile_definitions(freetype PRIVATE _CRT_SECURE_NO_WARNINGS _CRT_NONSTDC_NO_WARNINGS)
if (BUILD_SHARED_LIBS)
target_compile_definitions(freetype PRIVATE DLL_EXPORT)
endif ()
endif ()

if (BUILD_SHARED_LIBS)
set_target_properties(freetype PROPERTIES VERSION ${LIBRARY_VERSION} SOVERSION ${LIBRARY_SOVERSION})
endif ()

# Pick up ftconfig.h and ftoption.h generated above, first.
target_include_directories(
freetype
PUBLIC
$<INSTALL_INTERFACE:include/freetype2>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/include

# Make <ftconfig.h> available for builds/unix/ftsystem.c.
${CMAKE_CURRENT_BINARY_DIR}/include/freetype/config
)

if (BUILD_SHARED_LIBS)
install(TARGETS freetype
LIBRARY DESTINATION "${LIB_TARGET}/lib"
ARCHIVE DESTINATION "${LIB_TARGET}/lib"
RUNTIME DESTINATION "${LIB_TARGET}/lib")
endif ()
46 changes: 46 additions & 0 deletions 3rdparty/freetype-2.13.2/LICENSE.TXT
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
FREETYPE LICENSES
-----------------

The FreeType 2 font engine is copyrighted work and cannot be used
legally without a software license. In order to make this project
usable to a vast majority of developers, we distribute it under two
mutually exclusive open-source licenses.

This means that *you* must choose *one* of the two licenses described
below, then obey all its terms and conditions when using FreeType 2 in
any of your projects or products.

- The FreeType License, found in the file `docs/FTL.TXT`, which is
similar to the original BSD license *with* an advertising clause
that forces you to explicitly cite the FreeType project in your
product's documentation. All details are in the license file.
This license is suited to products which don't use the GNU General
Public License.

Note that this license is compatible to the GNU General Public
License version 3, but not version 2.

- The GNU General Public License version 2, found in
`docs/GPLv2.TXT` (any later version can be used also), for
programs which already use the GPL. Note that the FTL is
incompatible with GPLv2 due to its advertisement clause.

The contributed BDF and PCF drivers come with a license similar to
that of the X Window System. It is compatible to the above two
licenses (see files `src/bdf/README` and `src/pcf/README`). The same
holds for the source code files `src/base/fthash.c` and
`include/freetype/internal/fthash.h`; they were part of the BDF driver
in earlier FreeType versions.

The gzip module uses the zlib license (see `src/gzip/zlib.h`) which
too is compatible to the above two licenses.

The files `src/autofit/ft-hb.c` and `src/autofit/ft-hb.h` contain code
taken almost verbatim from the HarfBuzz file `hb-ft.cc`, which uses
the 'Old MIT' license, compatible to the above two licenses.

The MD5 checksum support (only used for debugging in development
builds) is in the public domain.


--- end of LICENSE.TXT ---
52 changes: 52 additions & 0 deletions 3rdparty/freetype-2.13.2/builds/cmake/FindBrotliDec.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# FindBrotliDec.cmake
#
# Copyright (C) 2019-2023 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# Written by Werner Lemberg <wl@gnu.org>
#
# 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.
#
#
# Try to find libbrotlidec include and library directories.
#
# If found, the following variables are set.
#
# BROTLIDEC_INCLUDE_DIRS
# BROTLIDEC_LIBRARIES

find_package(PkgConfig QUIET)

pkg_check_modules(PC_BROTLIDEC QUIET libbrotlidec)

if (PC_BROTLIDEC_VERSION)
set(BROTLIDEC_VERSION "${PC_BROTLIDEC_VERSION}")
endif ()


find_path(BROTLIDEC_INCLUDE_DIRS
NAMES brotli/decode.h
HINTS ${PC_BROTLIDEC_INCLUDEDIR}
${PC_BROTLIDEC_INCLUDE_DIRS}
PATH_SUFFIXES brotli)

find_library(BROTLIDEC_LIBRARIES
NAMES brotlidec
HINTS ${PC_BROTLIDEC_LIBDIR}
${PC_BROTLIDEC_LIBRARY_DIRS})


include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
BrotliDec
REQUIRED_VARS BROTLIDEC_INCLUDE_DIRS BROTLIDEC_LIBRARIES
FOUND_VAR BROTLIDEC_FOUND
VERSION_VAR BROTLIDEC_VERSION)

mark_as_advanced(
BROTLIDEC_INCLUDE_DIRS
BROTLIDEC_LIBRARIES)
Loading

0 comments on commit 0992e34

Please sign in to comment.