Changeset - r20455:4851057db176
[Not reviewed]
master
0 9 0
rubidium - 11 years ago 2013-06-25 20:40:58
rubidium@openttd.org
(svn r25470) -Feature-ish: use ICU's layout engine when that's available
9 files changed with 160 insertions and 27 deletions:
0 comments (0 inline, 0 general)
config.lib
Show inline comments
 
@@ -1715,15 +1715,15 @@ make_cflags_and_ldflags() {
 
	if [ -n "$icu_config" ]; then
 
		CFLAGS="$CFLAGS -DWITH_ICU"
 
		CFLAGS="$CFLAGS `$icu_config --cppflags | tr '\n\r' '  '`"
 

	
 
		# Some icu-configs have the 'feature' of not adding a space where others do add the space
 
		if [ "$static_icu" != "0" ]; then
 
			LIBS="$LIBS `$icu_config --ldflags-searchpath` `$icu_config --ldflags-libsonly | tr '\n\r' '  ' | sed s/licu/lsicu/g`"
 
			LIBS="$LIBS `$icu_config --ldflags-searchpath` `$icu_config --ldflags-libsonly --ldflags-layout | tr '\n\r' '  ' | sed s/licu/lsicu/g`"
 
		else
 
			LIBS="$LIBS `$icu_config --ldflags-searchpath` `$icu_config --ldflags-libsonly | tr '\n\r' '  '`"
 
			LIBS="$LIBS `$icu_config --ldflags-searchpath` `$icu_config --ldflags-libsonly --ldflags-layout | tr '\n\r' '  '`"
 
		fi
 
	fi
 

	
 

	
 
	if [ "$with_direct_music" != "0" ]; then
 
		CFLAGS="$CFLAGS -DWIN32_ENABLE_DIRECTMUSIC_SUPPORT"
projects/openttd_vs100.vcxproj
Show inline comments
 
@@ -128,13 +128,13 @@
 
    </ClCompile>
 
    <ResourceCompile>
 
      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
 
      <Culture>0x0809</Culture>
 
    </ResourceCompile>
 
    <Link>
 
      <AdditionalDependencies>winmm.lib;ws2_32.lib;libpng.lib;zlibstat.lib;lzo2.lib;liblzma.lib;libfreetype2.lib;icuuc.lib;icuin.lib;icudt.lib;%(AdditionalDependencies)</AdditionalDependencies>
 
      <AdditionalDependencies>winmm.lib;ws2_32.lib;libpng.lib;zlibstat.lib;lzo2.lib;liblzma.lib;libfreetype2.lib;icuuc.lib;icuin.lib;icudt.lib;icule.lib;iculx.lib;%(AdditionalDependencies)</AdditionalDependencies>
 
      <SuppressStartupBanner>true</SuppressStartupBanner>
 
      <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
 
      <GenerateDebugInformation>true</GenerateDebugInformation>
 
      <SubSystem>Windows</SubSystem>
 
      <StackReserveSize>1048576</StackReserveSize>
 
      <StackCommitSize>1048576</StackCommitSize>
 
@@ -173,13 +173,13 @@
 
    </ClCompile>
 
    <ResourceCompile>
 
      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
 
      <Culture>0x0809</Culture>
 
    </ResourceCompile>
 
    <Link>
 
      <AdditionalDependencies>winmm.lib;ws2_32.lib;libpng.lib;zlibstat.lib;lzo2.lib;liblzma.lib;libfreetype2.lib;icuuc.lib;icuin.lib;icudt.lib;%(AdditionalDependencies)</AdditionalDependencies>
 
      <AdditionalDependencies>winmm.lib;ws2_32.lib;libpng.lib;zlibstat.lib;lzo2.lib;liblzma.lib;libfreetype2.lib;icuuc.lib;icuin.lib;icudt.lib;icule.lib;iculx.lib;%(AdditionalDependencies)</AdditionalDependencies>
 
      <SuppressStartupBanner>true</SuppressStartupBanner>
 
      <IgnoreSpecificDefaultLibraries>LIBCMT.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
 
      <GenerateDebugInformation>true</GenerateDebugInformation>
 
      <SubSystem>Windows</SubSystem>
 
      <StackReserveSize>1048576</StackReserveSize>
 
      <StackCommitSize>1048576</StackCommitSize>
 
@@ -230,13 +230,13 @@
 
    </ClCompile>
 
    <ResourceCompile>
 
      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
 
      <Culture>0x0809</Culture>
 
    </ResourceCompile>
 
    <Link>
 
      <AdditionalDependencies>winmm.lib;ws2_32.lib;libpng.lib;zlibstat.lib;lzo2.lib;liblzma.lib;libfreetype2.lib;icuuc.lib;icuin.lib;icudt.lib;%(AdditionalDependencies)</AdditionalDependencies>
 
      <AdditionalDependencies>winmm.lib;ws2_32.lib;libpng.lib;zlibstat.lib;lzo2.lib;liblzma.lib;libfreetype2.lib;icuuc.lib;icuin.lib;icudt.lib;icule.lib;iculx.lib;%(AdditionalDependencies)</AdditionalDependencies>
 
      <SuppressStartupBanner>true</SuppressStartupBanner>
 
      <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
 
      <GenerateDebugInformation>true</GenerateDebugInformation>
 
      <SubSystem>Windows</SubSystem>
 
      <StackReserveSize>1048576</StackReserveSize>
 
      <StackCommitSize>1048576</StackCommitSize>
 
@@ -277,13 +277,13 @@
 
    </ClCompile>
 
    <ResourceCompile>
 
      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
 
      <Culture>0x0809</Culture>
 
    </ResourceCompile>
 
    <Link>
 
      <AdditionalDependencies>winmm.lib;ws2_32.lib;libpng.lib;zlibstat.lib;lzo2.lib;liblzma.lib;libfreetype2.lib;icuuc.lib;icuin.lib;icudt.lib;%(AdditionalDependencies)</AdditionalDependencies>
 
      <AdditionalDependencies>winmm.lib;ws2_32.lib;libpng.lib;zlibstat.lib;lzo2.lib;liblzma.lib;libfreetype2.lib;icuuc.lib;icuin.lib;icudt.lib;icule.lib;iculx.lib;%(AdditionalDependencies)</AdditionalDependencies>
 
      <SuppressStartupBanner>true</SuppressStartupBanner>
 
      <IgnoreSpecificDefaultLibraries>LIBCMT.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
 
      <GenerateDebugInformation>true</GenerateDebugInformation>
 
      <SubSystem>Windows</SubSystem>
 
      <StackReserveSize>1048576</StackReserveSize>
 
      <StackCommitSize>1048576</StackCommitSize>
projects/openttd_vs100.vcxproj.in
Show inline comments
 
@@ -128,13 +128,13 @@
 
    </ClCompile>
 
    <ResourceCompile>
 
      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
 
      <Culture>0x0809</Culture>
 
    </ResourceCompile>
 
    <Link>
 
      <AdditionalDependencies>winmm.lib;ws2_32.lib;libpng.lib;zlibstat.lib;lzo2.lib;liblzma.lib;libfreetype2.lib;icuuc.lib;icuin.lib;icudt.lib;%(AdditionalDependencies)</AdditionalDependencies>
 
      <AdditionalDependencies>winmm.lib;ws2_32.lib;libpng.lib;zlibstat.lib;lzo2.lib;liblzma.lib;libfreetype2.lib;icuuc.lib;icuin.lib;icudt.lib;icule.lib;iculx.lib;%(AdditionalDependencies)</AdditionalDependencies>
 
      <SuppressStartupBanner>true</SuppressStartupBanner>
 
      <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
 
      <GenerateDebugInformation>true</GenerateDebugInformation>
 
      <SubSystem>Windows</SubSystem>
 
      <StackReserveSize>1048576</StackReserveSize>
 
      <StackCommitSize>1048576</StackCommitSize>
 
@@ -173,13 +173,13 @@
 
    </ClCompile>
 
    <ResourceCompile>
 
      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
 
      <Culture>0x0809</Culture>
 
    </ResourceCompile>
 
    <Link>
 
      <AdditionalDependencies>winmm.lib;ws2_32.lib;libpng.lib;zlibstat.lib;lzo2.lib;liblzma.lib;libfreetype2.lib;icuuc.lib;icuin.lib;icudt.lib;%(AdditionalDependencies)</AdditionalDependencies>
 
      <AdditionalDependencies>winmm.lib;ws2_32.lib;libpng.lib;zlibstat.lib;lzo2.lib;liblzma.lib;libfreetype2.lib;icuuc.lib;icuin.lib;icudt.lib;icule.lib;iculx.lib;%(AdditionalDependencies)</AdditionalDependencies>
 
      <SuppressStartupBanner>true</SuppressStartupBanner>
 
      <IgnoreSpecificDefaultLibraries>LIBCMT.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
 
      <GenerateDebugInformation>true</GenerateDebugInformation>
 
      <SubSystem>Windows</SubSystem>
 
      <StackReserveSize>1048576</StackReserveSize>
 
      <StackCommitSize>1048576</StackCommitSize>
 
@@ -230,13 +230,13 @@
 
    </ClCompile>
 
    <ResourceCompile>
 
      <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
 
      <Culture>0x0809</Culture>
 
    </ResourceCompile>
 
    <Link>
 
      <AdditionalDependencies>winmm.lib;ws2_32.lib;libpng.lib;zlibstat.lib;lzo2.lib;liblzma.lib;libfreetype2.lib;icuuc.lib;icuin.lib;icudt.lib;%(AdditionalDependencies)</AdditionalDependencies>
 
      <AdditionalDependencies>winmm.lib;ws2_32.lib;libpng.lib;zlibstat.lib;lzo2.lib;liblzma.lib;libfreetype2.lib;icuuc.lib;icuin.lib;icudt.lib;icule.lib;iculx.lib;%(AdditionalDependencies)</AdditionalDependencies>
 
      <SuppressStartupBanner>true</SuppressStartupBanner>
 
      <IgnoreSpecificDefaultLibraries>%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
 
      <GenerateDebugInformation>true</GenerateDebugInformation>
 
      <SubSystem>Windows</SubSystem>
 
      <StackReserveSize>1048576</StackReserveSize>
 
      <StackCommitSize>1048576</StackCommitSize>
 
@@ -277,13 +277,13 @@
 
    </ClCompile>
 
    <ResourceCompile>
 
      <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
 
      <Culture>0x0809</Culture>
 
    </ResourceCompile>
 
    <Link>
 
      <AdditionalDependencies>winmm.lib;ws2_32.lib;libpng.lib;zlibstat.lib;lzo2.lib;liblzma.lib;libfreetype2.lib;icuuc.lib;icuin.lib;icudt.lib;%(AdditionalDependencies)</AdditionalDependencies>
 
      <AdditionalDependencies>winmm.lib;ws2_32.lib;libpng.lib;zlibstat.lib;lzo2.lib;liblzma.lib;libfreetype2.lib;icuuc.lib;icuin.lib;icudt.lib;icule.lib;iculx.lib;%(AdditionalDependencies)</AdditionalDependencies>
 
      <SuppressStartupBanner>true</SuppressStartupBanner>
 
      <IgnoreSpecificDefaultLibraries>LIBCMT.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
 
      <GenerateDebugInformation>true</GenerateDebugInformation>
 
      <SubSystem>Windows</SubSystem>
 
      <StackReserveSize>1048576</StackReserveSize>
 
      <StackCommitSize>1048576</StackCommitSize>
projects/openttd_vs80.vcproj
Show inline comments
 
@@ -84,13 +84,13 @@
 
			/>
 
			<Tool
 
				Name="VCPreLinkEventTool"
 
			/>
 
			<Tool
 
				Name="VCLinkerTool"
 
				AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib"
 
				AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib icule.lib iculx.lib"
 
				LinkIncremental="1"
 
				SuppressStartupBanner="true"
 
				IgnoreDefaultLibraryNames=""
 
				GenerateDebugInformation="true"
 
				SubSystem="2"
 
				StackReserveSize="1048576"
 
@@ -181,13 +181,13 @@
 
			/>
 
			<Tool
 
				Name="VCPreLinkEventTool"
 
			/>
 
			<Tool
 
				Name="VCLinkerTool"
 
				AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib"
 
				AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib icule.lib iculx.lib"
 
				LinkIncremental="0"
 
				SuppressStartupBanner="true"
 
				IgnoreDefaultLibraryNames="LIBCMT.lib"
 
				GenerateDebugInformation="true"
 
				SubSystem="2"
 
				StackReserveSize="1048576"
 
@@ -289,13 +289,13 @@
 
			/>
 
			<Tool
 
				Name="VCPreLinkEventTool"
 
			/>
 
			<Tool
 
				Name="VCLinkerTool"
 
				AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib"
 
				AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib icule.lib iculx.lib"
 
				LinkIncremental="1"
 
				SuppressStartupBanner="true"
 
				IgnoreDefaultLibraryNames=""
 
				GenerateDebugInformation="true"
 
				SubSystem="2"
 
				StackReserveSize="1048576"
 
@@ -389,13 +389,13 @@
 
			/>
 
			<Tool
 
				Name="VCPreLinkEventTool"
 
			/>
 
			<Tool
 
				Name="VCLinkerTool"
 
				AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib"
 
				AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib icule.lib iculx.lib"
 
				LinkIncremental="0"
 
				SuppressStartupBanner="true"
 
				IgnoreDefaultLibraryNames="LIBCMT.lib"
 
				GenerateDebugInformation="true"
 
				SubSystem="2"
 
				StackReserveSize="1048576"
projects/openttd_vs80.vcproj.in
Show inline comments
 
@@ -84,13 +84,13 @@
 
			/>
 
			<Tool
 
				Name="VCPreLinkEventTool"
 
			/>
 
			<Tool
 
				Name="VCLinkerTool"
 
				AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib"
 
				AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib icule.lib iculx.lib"
 
				LinkIncremental="1"
 
				SuppressStartupBanner="true"
 
				IgnoreDefaultLibraryNames=""
 
				GenerateDebugInformation="true"
 
				SubSystem="2"
 
				StackReserveSize="1048576"
 
@@ -181,13 +181,13 @@
 
			/>
 
			<Tool
 
				Name="VCPreLinkEventTool"
 
			/>
 
			<Tool
 
				Name="VCLinkerTool"
 
				AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib"
 
				AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib icule.lib iculx.lib"
 
				LinkIncremental="0"
 
				SuppressStartupBanner="true"
 
				IgnoreDefaultLibraryNames="LIBCMT.lib"
 
				GenerateDebugInformation="true"
 
				SubSystem="2"
 
				StackReserveSize="1048576"
 
@@ -289,13 +289,13 @@
 
			/>
 
			<Tool
 
				Name="VCPreLinkEventTool"
 
			/>
 
			<Tool
 
				Name="VCLinkerTool"
 
				AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib"
 
				AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib icule.lib iculx.lib"
 
				LinkIncremental="1"
 
				SuppressStartupBanner="true"
 
				IgnoreDefaultLibraryNames=""
 
				GenerateDebugInformation="true"
 
				SubSystem="2"
 
				StackReserveSize="1048576"
 
@@ -389,13 +389,13 @@
 
			/>
 
			<Tool
 
				Name="VCPreLinkEventTool"
 
			/>
 
			<Tool
 
				Name="VCLinkerTool"
 
				AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib"
 
				AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib icule.lib iculx.lib"
 
				LinkIncremental="0"
 
				SuppressStartupBanner="true"
 
				IgnoreDefaultLibraryNames="LIBCMT.lib"
 
				GenerateDebugInformation="true"
 
				SubSystem="2"
 
				StackReserveSize="1048576"
projects/openttd_vs90.vcproj
Show inline comments
 
@@ -85,13 +85,13 @@
 
			/>
 
			<Tool
 
				Name="VCPreLinkEventTool"
 
			/>
 
			<Tool
 
				Name="VCLinkerTool"
 
				AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib"
 
				AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib icule.lib iculx.lib"
 
				LinkIncremental="1"
 
				SuppressStartupBanner="true"
 
				IgnoreDefaultLibraryNames=""
 
				GenerateDebugInformation="true"
 
				SubSystem="2"
 
				StackReserveSize="1048576"
 
@@ -180,13 +180,13 @@
 
			/>
 
			<Tool
 
				Name="VCPreLinkEventTool"
 
			/>
 
			<Tool
 
				Name="VCLinkerTool"
 
				AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib"
 
				AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib icule.lib iculx.lib"
 
				LinkIncremental="0"
 
				SuppressStartupBanner="true"
 
				IgnoreDefaultLibraryNames="LIBCMT.lib"
 
				GenerateDebugInformation="true"
 
				SubSystem="2"
 
				StackReserveSize="1048576"
 
@@ -287,13 +287,13 @@
 
			/>
 
			<Tool
 
				Name="VCPreLinkEventTool"
 
			/>
 
			<Tool
 
				Name="VCLinkerTool"
 
				AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib"
 
				AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib icule.lib iculx.lib"
 
				LinkIncremental="1"
 
				SuppressStartupBanner="true"
 
				IgnoreDefaultLibraryNames=""
 
				GenerateDebugInformation="true"
 
				SubSystem="2"
 
				StackReserveSize="1048576"
 
@@ -386,13 +386,13 @@
 
			/>
 
			<Tool
 
				Name="VCPreLinkEventTool"
 
			/>
 
			<Tool
 
				Name="VCLinkerTool"
 
				AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib"
 
				AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib icule.lib iculx.lib"
 
				LinkIncremental="0"
 
				SuppressStartupBanner="true"
 
				IgnoreDefaultLibraryNames="LIBCMT.lib"
 
				GenerateDebugInformation="true"
 
				SubSystem="2"
 
				StackReserveSize="1048576"
projects/openttd_vs90.vcproj.in
Show inline comments
 
@@ -85,13 +85,13 @@
 
			/>
 
			<Tool
 
				Name="VCPreLinkEventTool"
 
			/>
 
			<Tool
 
				Name="VCLinkerTool"
 
				AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib"
 
				AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib icule.lib iculx.lib"
 
				LinkIncremental="1"
 
				SuppressStartupBanner="true"
 
				IgnoreDefaultLibraryNames=""
 
				GenerateDebugInformation="true"
 
				SubSystem="2"
 
				StackReserveSize="1048576"
 
@@ -180,13 +180,13 @@
 
			/>
 
			<Tool
 
				Name="VCPreLinkEventTool"
 
			/>
 
			<Tool
 
				Name="VCLinkerTool"
 
				AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib"
 
				AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib icule.lib iculx.lib"
 
				LinkIncremental="0"
 
				SuppressStartupBanner="true"
 
				IgnoreDefaultLibraryNames="LIBCMT.lib"
 
				GenerateDebugInformation="true"
 
				SubSystem="2"
 
				StackReserveSize="1048576"
 
@@ -287,13 +287,13 @@
 
			/>
 
			<Tool
 
				Name="VCPreLinkEventTool"
 
			/>
 
			<Tool
 
				Name="VCLinkerTool"
 
				AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib"
 
				AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib icule.lib iculx.lib"
 
				LinkIncremental="1"
 
				SuppressStartupBanner="true"
 
				IgnoreDefaultLibraryNames=""
 
				GenerateDebugInformation="true"
 
				SubSystem="2"
 
				StackReserveSize="1048576"
 
@@ -386,13 +386,13 @@
 
			/>
 
			<Tool
 
				Name="VCPreLinkEventTool"
 
			/>
 
			<Tool
 
				Name="VCLinkerTool"
 
				AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib"
 
				AdditionalDependencies="winmm.lib ws2_32.lib libpng.lib zlibstat.lib lzo2.lib liblzma.lib libfreetype2.lib icuuc.lib icuin.lib icudt.lib icule.lib iculx.lib"
 
				LinkIncremental="0"
 
				SuppressStartupBanner="true"
 
				IgnoreDefaultLibraryNames="LIBCMT.lib"
 
				GenerateDebugInformation="true"
 
				SubSystem="2"
 
				StackReserveSize="1048576"
src/gfx_layout.cpp
Show inline comments
 
@@ -9,26 +9,128 @@
 

	
 
/** @file gfx_layout.cpp Handling of laying out text. */
 

	
 
#include "stdafx.h"
 
#include "gfx_layout.h"
 
#include "string_func.h"
 
#include "strings_func.h"
 

	
 
#include "table/control_codes.h"
 

	
 
#ifdef WITH_ICU
 
#include <unicode/ustring.h>
 
#endif /* WITH_ICU */
 

	
 
/**
 
 * Construct a new font.
 
 * @param size   The font size to use for this font.
 
 * @param colour The colour to draw this font in.
 
 */
 
Font::Font(FontSize size, TextColour colour) :
 
		fc(FontCache::Get(size)), colour(colour)
 
{
 
	assert(size < FS_END);
 
}
 

	
 
#ifdef WITH_ICU
 
/* Implementation details of LEFontInstance */
 

	
 
le_int32 Font::getUnitsPerEM() const
 
{
 
	return this->fc->GetUnitsPerEM();
 
}
 

	
 
le_int32 Font::getAscent() const
 
{
 
	return this->fc->GetAscender();
 
}
 

	
 
le_int32 Font::getDescent() const
 
{
 
	return -this->fc->GetDescender();
 
}
 

	
 
le_int32 Font::getLeading() const
 
{
 
	return this->fc->GetHeight();
 
}
 

	
 
float Font::getXPixelsPerEm() const
 
{
 
	return (float)this->fc->GetHeight();
 
}
 

	
 
float Font::getYPixelsPerEm() const
 
{
 
	return (float)this->fc->GetHeight();
 
}
 

	
 
float Font::getScaleFactorX() const
 
{
 
	return 1.0f;
 
}
 

	
 
float Font::getScaleFactorY() const
 
{
 
	return 1.0f;
 
}
 

	
 
const void *Font::getFontTable(LETag tableTag) const
 
{
 
	return this->fc->GetFontTable(tableTag);
 
}
 

	
 
LEGlyphID Font::mapCharToGlyph(LEUnicode32 ch) const
 
{
 
	if (IsTextDirectionChar(ch)) return 0;
 
	return this->fc->MapCharToGlyph(ch);
 
}
 

	
 
void Font::getGlyphAdvance(LEGlyphID glyph, LEPoint &advance) const
 
{
 
	advance.fX = glyph == 0xFFFF ? 0 : this->fc->GetGlyphWidth(glyph);
 
	advance.fY = 0;
 
}
 

	
 
le_bool Font::getGlyphPoint(LEGlyphID glyph, le_int32 pointNumber, LEPoint &point) const
 
{
 
	return FALSE;
 
}
 

	
 
size_t Layouter::AppendToBuffer(UChar *buff, const UChar *buffer_last, WChar c)
 
{
 
	/* Transform from UTF-32 to internal ICU format of UTF-16. */
 
	int32 length = 0;
 
	UErrorCode err = U_ZERO_ERROR;
 
	u_strFromUTF32(buff, buffer_last - buff, &length, (UChar32*)&c, 1, &err);
 
	return length;
 
}
 

	
 
ParagraphLayout *Layouter::GetParagraphLayout(UChar *buff)
 
{
 
	int32 length = buff - this->buffer;
 

	
 
	if (length == 0) {
 
		/* ICU's ParagraphLayout cannot handle empty strings, so fake one. */
 
		this->buffer[0] = ' ';
 
		length = 1;
 
		this->fonts.End()[-1].first++;
 
	}
 

	
 
	/* Fill ICU's FontRuns with the right data. */
 
	FontRuns runs(this->fonts.Length());
 
	for (FontMap::iterator iter = this->fonts.Begin(); iter != this->fonts.End(); iter++) {
 
		runs.add(iter->second, iter->first);
 
	}
 

	
 
	LEErrorCode status = LE_NO_ERROR;
 
	return new ParagraphLayout(this->buffer, length, &runs, NULL, NULL, NULL, _current_text_dir == TD_RTL ? UBIDI_DEFAULT_RTL : UBIDI_DEFAULT_LTR, false, status);
 
}
 

	
 
#else /* WITH_ICU */
 

	
 
/*** Paragraph layout ***/
 

	
 
/**
 
 * Create the visual run.
 
 * @param font       The font to use for this run.
 
 * @param chars      The characters to use for this run.
 
@@ -273,12 +375,13 @@ size_t Layouter::AppendToBuffer(WChar *b
 
 * @return The ParagraphLayout instance.
 
 */
 
ParagraphLayout *Layouter::GetParagraphLayout(WChar *buff_end)
 
{
 
	return new ParagraphLayout(this->buffer, buff_end - this->buffer, this->fonts);
 
}
 
#endif /* !WITH_ICU */
 

	
 
/**
 
 * Create a new layouter.
 
 * @param str      The string to create the layout for.
 
 * @param maxw     The maximum width.
 
 * @param colour   The colour of the font.
src/gfx_layout.h
Show inline comments
 
@@ -13,26 +13,51 @@
 
#define GFX_LAYOUT_H
 

	
 
#include "fontcache.h"
 
#include "gfx_func.h"
 
#include "core/smallmap_type.hpp"
 

	
 
#ifdef WITH_ICU
 
#include "layout/ParagraphLayout.h"
 
#define ICU_FONTINSTANCE : public LEFontInstance
 
#else /* WITH_ICU */
 
#define ICU_FONTINSTANCE
 
#endif /* WITH_ICU */
 

	
 
/**
 
 * Container with information about a font.
 
 */
 
class Font {
 
class Font ICU_FONTINSTANCE {
 
public:
 
	FontCache *fc;     ///< The font we are using.
 
	TextColour colour; ///< The colour this font has to be.
 

	
 
	Font(FontSize size, TextColour colour);
 

	
 
#ifdef WITH_ICU
 
	/* Implementation details of LEFontInstance */
 

	
 
	le_int32 getUnitsPerEM() const;
 
	le_int32 getAscent() const;
 
	le_int32 getDescent() const;
 
	le_int32 getLeading() const;
 
	float getXPixelsPerEm() const;
 
	float getYPixelsPerEm() const;
 
	float getScaleFactorX() const;
 
	float getScaleFactorY() const;
 
	const void *getFontTable(LETag tableTag) const;
 
	LEGlyphID mapCharToGlyph(LEUnicode32 ch) const;
 
	void getGlyphAdvance(LEGlyphID glyph, LEPoint &advance) const;
 
	le_bool getGlyphPoint(LEGlyphID glyph, le_int32 pointNumber, LEPoint &point) const;
 
#endif /* WITH_ICU */
 
};
 

	
 
/** Mapping from index to font. */
 
typedef SmallMap<int, Font *> FontMap;
 

	
 
#ifndef WITH_ICU
 
/**
 
 * Class handling the splitting of a paragraph of text into lines and
 
 * visual runs.
 
 *
 
 * One constructs this class with the text that needs to be split into
 
 * lines. Then nextLine is called with the maximum width until NULL is
 
@@ -82,20 +107,25 @@ public:
 
	WChar *buffer;             ///< The current location in the buffer.
 
	FontMap &runs;             ///< The fonts we have to use for this paragraph.
 

	
 
	ParagraphLayout(WChar *buffer, int length, FontMap &runs);
 
	Line *nextLine(int max_width);
 
};
 
#endif /* !WITH_ICU */
 

	
 
/**
 
 * The layouter performs all the layout work.
 
 *
 
 * It also accounts for the memory allocations and frees.
 
 */
 
class Layouter : public AutoDeleteSmallVector<ParagraphLayout::Line *, 4> {
 
#ifdef WITH_ICU
 
	typedef UChar CharType; ///< The type of character used within the layouter.
 
#else /* WITH_ICU */
 
	typedef WChar CharType; ///< The type of character used within the layouter.
 
#endif /* WITH_ICU */
 

	
 
	size_t AppendToBuffer(CharType *buff, const CharType *buffer_last, WChar c);
 
	ParagraphLayout *GetParagraphLayout(CharType *buff);
 

	
 
	CharType buffer[DRAW_STRING_BUFFER]; ///< Buffer for the text that is going to be drawn.
 
	FontMap fonts;                       ///< The fonts needed for drawing.
0 comments (0 inline, 0 general)