Permalink
Browse files

implement RFC98 (#4673) and RFC99 (#4704)

- implement complex scrit shaping via harfbuzz
- refactor text rendering pipeline
- remove support for GD renderer
- remove support for deprecated annotation layers
  • Loading branch information...
tbonfort committed May 20, 2013
1 parent 42733c2 commit 18b51c4a36e6447793a48744f64adcb7c20585e2
Showing with 7,816 additions and 8,375 deletions.
  1. +11 −1 .travis.yml
  2. +52 −41 CMakeLists.txt
  3. +3 −0 INSTALL.CMAKE
  4. +3 −3 Makefile
  5. +50 −0 cmake/FindHarfBuzz.cmake
  6. +300 −0 fontcache.c
  7. +86 −0 fontcache.h
  8. +1 −2 hittest.c
  9. +1 −0 legend.c
  10. +325 −354 mapagg.cpp
  11. +57 −290 mapcairo.c
  12. +17 −14 mapchart.c
  13. +4 −8 mapcontext.c
  14. +21 −13 mapcopy.c
  15. +0 −11 mapcopy.h
  16. +940 −1,076 mapdraw.c
  17. +34 −460 mapdrawgdal.c
  18. +3 −12 mapdummyrenderer.c
  19. +60 −67 maperror.c
  20. +2 −2 maperror.h
  21. +64 −83 mapfile.c
  22. +0 −1,070 mapgd.c
  23. +12 −53 mapgdal.c
  24. +10 −10 mapgeomtransform.c
  25. +13 −3 mapgraticule.c
  26. +1 −298 mapimageio.c
  27. +9 −9 mapimagemap.c
  28. +0 −73 mapio.c
  29. +0 −4 mapio.h
  30. +3 −6 mapkml.cpp
  31. +8 −8 mapkmlrenderer.cpp
  32. +2 −2 mapkmlrenderer.h
  33. +644 −729 maplabel.c
  34. +173 −185 maplegend.c
  35. +1,887 −1,896 maplexer.c
  36. +2 −3 maplexer.l
  37. +0 −1 mapmssql2008.c
  38. +31 −34 mapogcsld.c
  39. +2 −3 mapogr.cpp
  40. +1 −2 mapogroutput.c
  41. +2 −54 mapoutput.c
  42. +0 −1 mappostgis.c
  43. +281 −359 mapprimitive.c
  44. +1 −1 mapproject.c
  45. +28 −136 mapraster.c
  46. +256 −231 maprendering.c
  47. +82 −178 mapresample.c
  48. +58 −19 mapscale.c
  49. +1 −1 mapscript/java/tests/threadtest/MapThread.java
  50. +1 −1 mapscript/php/CMakeLists.txt
  51. +1 −3 mapscript/php/class.c
  52. +1 −1 mapscript/php/cluster.c
  53. +0 −7 mapscript/php/image.c
  54. +1 −3 mapscript/php/label.c
  55. +2 −0 mapscript/php/labelcachemember.c
  56. +2 −4 mapscript/php/layer.c
  57. +15 −1 mapscript/php/map.c
  58. +1 −5 mapscript/php/mapscript_i.c
  59. +6 −12 mapscript/php/php_mapscript.c
  60. +16 −0 mapscript/php/php_mapscript.h
  61. +2 −0 mapscript/php/php_mapscript_util.c
  62. +4 −2 mapscript/php/style.c
  63. +0 −2 mapscript/php/symbol.c
  64. +3 −3 mapscript/python/pygdioctx/pygdioctx.c
  65. +0 −7 mapscript/python/tests/cases/layertest.py
  66. +0 −2 mapscript/python/tests/cases/symboltest.py
  67. +0 −1 mapscript/swiginc/class.i
  68. +5 −4 mapscript/swiginc/color.i
  69. +1 −90 mapscript/swiginc/image.i
  70. +1 −14 mapscript/swiginc/map.i
  71. +0 −1 mapscript/swiginc/rect.i
  72. +2 −2 mapsearch.c
  73. +2 −5 mapserver-config.h.in
  74. +217 −180 mapserver.h
  75. +3 −2 mapstring.c
  76. +33 −18 mapsymbol.c
  77. +1 −13 mapsymbol.h
  78. +14 −17 maptclutf.c
  79. +40 −54 maptemplate.c
  80. +4 −1 maptile.c
  81. +6 −5 mapunion.c
  82. +39 −74 maputil.c
  83. +5 −1 mapwcs.c
  84. +0 −3 mapwcs11.c
  85. +3 −5 mapwcs20.c
  86. +4 −12 mapwms.c
  87. +2 −6 mapwmslayer.c
  88. +1 −1 msautotest
  89. +4 −0 renderers/agg/include/agg_basics.h
  90. +10 −0 renderers/agg/include/agg_glyph_raster_bin.h
  91. +28 −0 renderers/agg/include/agg_renderer_raster_text.h
  92. +1 −1 sym2img.c
  93. +5 −6 tests/test.map
  94. +849 −0 textlayout.c
  95. +940 −0 uthash.h
@@ -38,12 +38,22 @@ env:
compiler:
- gcc
- clang
before_install:
- mkdir tmp
- cd tmp
- wget http://www.freedesktop.org/software/harfbuzz/release/harfbuzz-0.9.19.tar.bz2
- tar xjf harfbuzz-0.9.19.tar.bz2
- cd harfbuzz-0.9.19
- ./configure --without-cairo --without-glib --without-icu
- make -j3
- sudo make install && sudo ldconfig
- cd ../..
- git submodule update --init --recursive
- sudo add-apt-repository -y ppa:ubuntugis/ubuntugis-unstable
- sudo apt-get update -qq
- sudo apt-get install -qq bison flex swig cmake librsvg2-dev colordiff postgis postgresql-9.1-postgis-2.0-scripts libpq-dev libpng12-dev libjpeg-dev libgif-dev libgeos-dev libgd2-noxpm-dev libfreetype6-dev libfcgi-dev libcurl4-gnutls-dev libcairo2-dev libgdal1-dev libproj-dev libxml2-dev python-dev php5-dev libexempi-dev lcov lftp
- sudo apt-get install -qq libfribidi-dev swig cmake librsvg2-dev colordiff postgis postgresql-9.1-postgis-2.0-scripts libpq-dev libpng12-dev libjpeg-dev libgif-dev libgeos-dev libgd2-noxpm-dev libfreetype6-dev libfcgi-dev libcurl4-gnutls-dev libcairo2-dev libgdal1-dev libproj-dev libxml2-dev python-dev php5-dev libexempi-dev lcov lftp
- sudo pip install git+git://github.com/tbonfort/cpp-coveralls.git@extensions
- cd msautotest
- ./create_postgis_test_data.sh
@@ -33,7 +33,9 @@ endif (APPLE)
macro (ms_link_libraries)
target_link_libraries(mapserver ${ARGV})
if(BUILD_DYNAMIC)
target_link_libraries(mapserver ${ARGV})
endif(BUILD_DYNAMIC)
if(BUILD_STATIC)
target_link_libraries(mapserver_static ${ARGV})
endif(BUILD_STATIC)
@@ -59,9 +61,10 @@ macro( report_dependency_error component dependency)
endmacro()
SET(CMAKE_REQUIRED_INCLUDES "math.h")
if(CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_REQUIRED_LIBRARIES "m")
endif(CMAKE_COMPILER_IS_GNUCXX)
if(NOT(WIN32))
SET(CMAKE_REQUIRED_LIBRARIES "m")
endif(NOT(WIN32))
check_function_exists("strrstr" HAVE_STRRSTR)
check_function_exists("strcasecmp" HAVE_STRCASECMP)
check_function_exists("strcasestr" HAVE_STRCASESTR)
@@ -93,8 +96,8 @@ option(WITH_PROJ "Choose if reprojection support should be built in" ON)
option(WITH_KML "Enable native KML output support (requires libxml2 support)" OFF)
option(WITH_SOS "Enable SOS Server support (requires PROJ and libxml2 support)" OFF)
option(WITH_WMS "Enable WMS Server support (requires proj support)" ON)
option(WITH_GD "Choose if (old) GD support should be built in" OFF)
option(WITH_FRIBIDI "Choose if FriBidi glyph shaping support should be built in (usefull for left-to-right languages)" ON)
option(WITH_FRIBIDI "Choose if FriBidi glyph shaping support should be built in (usefull for left-to-right languages) (requires HARFBUZZ)" ON)
option(WITH_HARFBUZZ "Choose if Harfbuzz complex text layout should be included (needed for e.g. arabic and hindi) (requires FRIBIDI)" ON)
option(WITH_ICONV "Choose if Iconv Internationalization support should be built in" ON)
option(WITH_CAIRO "Choose if CAIRO rendering support should be built in (required for SVG and PDF output)" ON)
option(WITH_SVGCAIRO "Choose if SVG symbology support (via libsvgcairo) should be built in (requires cairo, libsvg, libsvg-cairo. Incompatible with librsvg)" OFF)
@@ -138,7 +141,7 @@ option(WITH_GENERIC_NINT "generic rounding" OFF)
# PERLV_ld_DETECT?
# Add compiler flags for warnings
if(CMAKE_COMPILER_IS_GNUCXX)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wdeclaration-after-statement")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
endif()
@@ -148,8 +151,10 @@ SET(CMAKE_MACOSX_RPATH ON)
if(LINK_STATIC_LIBMAPSERVER)
set(BUILD_STATIC 1)
set(BUILD_DYNAMIC 0)
set(MAPSERVER_LIBMAPSERVER mapserver_static)
else(LINK_STATIC_LIBMAPSERVER)
set(BUILD_DYNAMIC 1)
set(MAPSERVER_LIBMAPSERVER mapserver)
endif(LINK_STATIC_LIBMAPSERVER)
@@ -166,7 +171,7 @@ renderers/agg/src/agg_line_aa_basics.cpp
renderers/agg/src/clipper.cpp
)
include_directories(renderers/agg/include)
#add_definitions(-DHASH_DEBUG=1)
if(WIN32)
set(REGEX_SOURCES ${REGEX_DIR}/regex.c)
include_directories(${REGEX_DIR})
@@ -179,7 +184,7 @@ else(WIN32)
set(REGEX_SOURCES "")
endif(WIN32)
set(mapserver_SOURCES
set(mapserver_SOURCES fontcache.c
cgiutil.c mapgeos.c maporaclespatial.c mapsearch.c mapwms.c classobject.c
mapgml.c mapoutput.c mapwmslayer.c layerobject.c mapgraticule.c mapows.c
mapservutil.c mapxbase.c maphash.c mapowscommon.c mapshape.c mapxml.c mapbits.c
@@ -192,17 +197,20 @@ mapprojhack.c maptree.c mapdebug.c maplexer.c mapquantization.c mapunion.c
mapdraw.c maplibxml2.c mapquery.c maputil.c strptime.c mapdrawgdal.c
mapraster.c mapuvraster.c mapdummyrenderer.c mapobject.c maprasterquery.c
mapwcs.c maperror.c mapogcfilter.c mapregex.c mapwcs11.c mapfile.c
mapogcfiltercommon.c maprendering.c mapwcs20.c mapgd.c mapogcsld.c
mapogcfiltercommon.c maprendering.c mapwcs20.c mapogcsld.c
mapresample.c mapwfs.c mapgdal.c mapogcsos.c mapscale.c mapwfs11.c
mapgeomtransform.c mapogroutput.c mapsde.c mapwfslayer.c mapagg.cpp mapkml.cpp
mapgeomutil.cpp mapkmlrenderer.cpp
mapgeomutil.cpp mapkmlrenderer.cpp fontcache.c textlayout.c
mapogr.cpp mapcontour.c mapsmoothing.c ${REGEX_SOURCES})
add_library(mapserver SHARED ${mapserver_SOURCES} ${agg_SOURCES})
set_target_properties( mapserver PROPERTIES
VERSION ${MapServer_VERSION_STRING}
SOVERSION 1
if(BUILD_DYNAMIC)
add_library(mapserver SHARED ${mapserver_SOURCES} ${agg_SOURCES})
set_target_properties( mapserver PROPERTIES
VERSION ${MapServer_VERSION_STRING}
SOVERSION 1
)
endif(BUILD_DYNAMIC)
if(BUILD_STATIC)
add_library(mapserver_static STATIC ${mapserver_SOURCES} ${agg_SOURCES})
set_target_properties( mapserver_static PROPERTIES
@@ -240,6 +248,10 @@ add_executable(shptreetst shptreetst.c)
target_link_libraries(shptreetst ${MAPSERVER_LIBMAPSERVER})
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
set(USE_EXTENDED_DEBUG 1)
endif (CMAKE_BUILD_TYPE STREQUAL "Debug")
find_package(PNG)
if(PNG_FOUND)
include_directories(${PNG_INCLUDE_DIR})
@@ -285,30 +297,6 @@ if(WITH_WMS)
endif(USE_PROJ)
endif(WITH_WMS)
if(WITH_GD)
find_package(GD)
if(NOT GD_FOUND)
report_optional_not_found(GD)
else(NOT GD_FOUND)
include_directories(${GD_INCLUDE_DIR})
ms_link_libraries( ${GD_LIBRARY})
set (USE_GD 1)
if(GD_SUPPORTS_PNG)
set(USE_GD_PNG 1)
endif(GD_SUPPORTS_PNG)
if(GD_SUPPORTS_GIF)
set(USE_GD_GIF 1)
endif(GD_SUPPORTS_GIF)
if(GD_SUPPORTS_JPEG)
set(USE_GD_JPEG 1)
endif(GD_SUPPORTS_JPEG)
if(GD_SUPPORTS_FREETYPE)
set(USE_GD_FREETYPE 1)
endif(GD_SUPPORTS_FREETYPE)
endif(NOT GD_FOUND)
endif (WITH_GD)
if(WITH_FRIBIDI)
find_package(FriBiDi)
if(NOT FRIBIDI_FOUND)
@@ -323,6 +311,25 @@ if(WITH_FRIBIDI)
endif(NOT FRIBIDI_FOUND)
endif (WITH_FRIBIDI)
if(WITH_HARFBUZZ)
find_package(HarfBuzz)
if(NOT HARFBUZZ_FOUND)
report_optional_not_found(HARFBUZZ)
else(NOT HARFBUZZ_FOUND)
include_directories(${HARFBUZZ_INCLUDE_DIR})
ms_link_libraries( ${HARFBUZZ_LIBRARY})
set (USE_HARFBUZZ 1)
endif(NOT HARFBUZZ_FOUND)
endif (WITH_HARFBUZZ)
if( USE_HARFBUZZ AND NOT(USE_FRIBIDI) )
report_dependency_error(HARFBUZZ FRIBIDI)
endif( USE_HARFBUZZ AND NOT(USE_FRIBIDI) )
if( USE_FRIBIDI AND NOT(USE_HARFBUZZ) )
report_dependency_error(FRIBIDI HARFBUZZ)
endif( USE_FRIBIDI AND NOT(USE_HARFBUZZ) )
if(WITH_ICONV)
find_package(ICONV)
if(ICONV_FOUND)
@@ -719,6 +726,8 @@ if(WITH_EXEMPI)
endif(LIBEXEMPI_FOUND)
endif(WITH_EXEMPI)
ms_link_libraries(harfbuzz)
if(WITH_PYTHON)
add_subdirectory("mapscript/python")
set(USE_PYTHON_MAPSCRIPT 1)
@@ -798,7 +807,6 @@ message(STATUS " * freetype: ${FREETYPE_LIBRARY}")
message(STATUS " * Optional components")
status_optional_component("GDAL" "${USE_GDAL}" "${GDAL_LIBRARY}")
status_optional_component("OGR" "${USE_OGR}" "${GDAL_LIBRARY}")
status_optional_component("GD" "${USE_GD}" "${GD_LIBRARY}")
status_optional_component("GIF" "${USE_GIF}" "${GIF_LIBRARY}")
status_optional_component("MYSQL" "${USE_MYSQL}" "${MYSQL_LIBRARY}")
status_optional_component("FRIBIDI" "${USE_FRIBIDI}" "${FRIBIDI_LIBRARY}")
@@ -885,8 +893,11 @@ if(USE_SDE92)
INSTALL(TARGETS msplugin_sde92 DESTINATION lib)
endif(USE_SDE92)
INSTALL(TARGETS sortshp shptree shptreevis msencrypt legend scalebar tile4ms shptreetst shp2img mapserv mapserver RUNTIME DESTINATION bin LIBRARY DESTINATION lib)
INSTALL(TARGETS sortshp shptree shptreevis msencrypt legend scalebar tile4ms shptreetst shp2img mapserv RUNTIME DESTINATION bin LIBRARY DESTINATION lib)
if(BUILD_STATIC)
INSTALL(TARGETS mapserver_static DESTINATION lib)
endif(BUILD_STATIC)
if(BUILD_DYNAMIC)
INSTALL(TARGETS mapserver DESTINATION lib)
endif(BUILD_DYNAMIC)
@@ -119,6 +119,9 @@ default (in which case the cmake step will fail if the dependency cannot be foun
of these can be enabled or disabled by passing "-DWITH_XXX=0" or "-DWITH_XXX=1" to the
"cmake .." invocation in order to override a default selection.
This Readme file may be out of sync with the actual CMakeLists files shipped.
Refer to the CMakeLists.txt file for up-to-date options.
- option(WITH_PROJ "Choose if reprojection support should be built in" ON)
- option(WITH_KML "Enable native KML output support (requires libxml2 support)" OFF)
- option(WITH_SOS "Enable SOS Server support (requires PROJ and libxml2 support)" OFF)
@@ -6,10 +6,10 @@ BUILDPATH=../../build
FLEX=flex
YACC=yacc
CMAKEFLAGS=-DCMAKE_C_FLAGS="--coverage" -DCMAKE_CXX_FLAGS="--coverage" \
-DCMAKE_SHARED_LINKER_FLAGS="-lgcov" -DWITH_GD=1 -DWITH_CLIENT_WMS=1 \
-DCMAKE_SHARED_LINKER_FLAGS="-lgcov" -DWITH_CLIENT_WMS=1 \
-DWITH_CLIENT_WFS=1 -DWITH_KML=1 -DWITH_SOS=1 -DWITH_PHP=1 \
-DWITH_PYTHON=1 -DWITH_JAVA=1 -DWITH_THREAD_SAFETY=1 -DWITH_FRIBIDI=0 -DWITH_FCGI=0 -DWITH_EXEMPI=1 \
-DCMAKE_BUILD_TYPE=Release -DWITH_RSVG=1 -DWITH_CURL=1
-DWITH_PYTHON=1 -DWITH_JAVA=1 -DWITH_THREAD_SAFETY=1 -DWITH_FRIBIDI=1 -DWITH_FCGI=0 -DWITH_EXEMPI=1 \
-DCMAKE_BUILD_TYPE=Release -DWITH_RSVG=1 -DWITH_CURL=1 -DWITH_HARFBUZZ=1
all: cmakebuild
cmakebuild: lexer parser
@@ -0,0 +1,50 @@
# Original Licence:
# Copyright (c) 2012, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither the name of Intel Corporation nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
# Try to find Harfbuzz include and library directories.
#
# After successful discovery, this will set for inclusion where needed:
# HARFBUZZ_INCLUDE_DIR - containg the HarfBuzz headers
# HARFBUZZ_LIBRARY - containg the HarfBuzz library
include(FindPkgConfig)
pkg_check_modules(PC_HARFBUZZ harfbuzz>=0.9.18)
find_path(HARFBUZZ_INCLUDE_DIR NAMES hb.h
HINTS ${PC_HARFBUZZ_INCLUDE_DIRS} ${PC_HARFBUZZ_INCLUDEDIR}
)
find_library(HARFBUZZ_LIBRARY NAMES harfbuzz
HINTS ${PC_HARFBUZZ_LIBRARY_DIRS} ${PC_HARFBUZZ_LIBDIR}
)
set(HARFBUZZ_INCLUDE_DIRS ${HARFBUZZ_INCLUDE_DIR})
set(HARFBUZZ_LIBRARIES ${HARFBUZZ_LIBRARY})
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(HarfBuzz DEFAULT_MSG HARFBUZZ_INCLUDE_DIR HARFBUZZ_LIBRARY)
mark_as_advanced(HARFBUZZ_LIBRARY HARFBUZZ_INCLUDE_DIR)
Oops, something went wrong.

0 comments on commit 18b51c4

Please sign in to comment.