On Mon, 2008-11-10 at 00:23 -0500, Jean-Sébastien Guay wrote:
> Hi Jeremy,
> 
> > I'm working on packing up my changes for osgCairo and osgPango now. Will 
> > send soon.
> 
> I've finished my first pass of changes to make osgCairo and osgPango 
> build and run on Windows. The result is attached to this message, as SVN 
> patches.
> 
> I've tried to comment changes to the CMake files so that you know why 
> they're required. In general, they're analogous to things in OSG's CMake 
> files. Also, there is one added file in each case 
> (include/osg{Pango|Cairo}/Export), make sure you don't miss it.
> 
> Note that some changes might strike you as unneeded, but MSVC requires 
> them. Such changes are for example the cast to double in fabs (MSVC 
> gives an "ambiguous function call" error if fabs is called with an int 
> but returning a double), and the default arguments for some constructors 
> so that you get the equivalent of a default constructor.
> 
> One thing I didn't test is anything that depends on recent changes in 
> the osgWidget branch. I didn't compile the osgWidget branch here at 
> home, so I just wanted things to compile for this first pass (anything 
> else was gravy). As a result, I just commented out such things and 
> compiled. One example is in osgPango/src/Label.cpp (Label::parented() 
> and Label::_removeDrawables()). Also, I commented out osgpangoanimation 
> and osgpangoguiviewer from the osgPango CMakeLists.txt file just so I 
> could get a full build and install. I haven't included those changes, 
> but I also haven't tested those functionalities as a result.
> 
> I've taken a bit more time in order to actually test some things. Here 
> are the results:
> 
> * "osgcairoviewer" runs and gives the image attached
>    (osgcairoviewer.jpg, resized to 25%)
> 
> * "osgcairowidget" runs and gives the image attached
>    (osgcairowidget.jpg, resized to 25%)
> 
> * "osgcairomatrix" runs and gives the output in osgcairomatrix.txt
> 
> * "osgpangofonts" runs and gives the output in osgpangofonts.txt
> 
> * "osgpangoviewer --font "Arial 20" --width 800 --alignment justify
>     --alpha 0.6" runs and gives the image attached (only the bottom part
>     of the screen, with the cow rotated slightly to show the alpha is
>     correct)

So, are you able to notice any difference in font quality under Windows?
Each glyph should be sharp and crisp, with absolutely not visual
anomalies of any sort. This is harder to do than you might think, so it
was always the most important (and the reason for writing the kit in the
first place!)

Also, add:

        --cache outline 2

...as an arg, or:

        --cache shadowOffset 1

...or something like that. :)

> * "osgpangocustomrenderer" runs and gives the image attached
>    (osgpangocustomrenderer.jpg, resized to 25%) but also outputs the
>    following warning (though it seems normal since I really don't have
>    that font :-) ):
> 
>    (osgpangocustomrenderer.exe:1476): Pango-WARNING **: couldn't load
>    font "iNked God Not-Rotated 45", falling back to "Sans Not-Rotated
>    45", expect ugly output.
> 
> So, all the examples I've been able to compile seem to run perfectly, 
> both in debug and release, on Windows. I think that's pretty cool. :-)
> 
> As soon as you can integrate these changes, I'll re-update at work 
> (where I have the osgWidget branch compiling regularly) and try out the 
> other things.
> 
> Good night,
> 
> J-S
> plain text document attachment (osgCairo.patch)
> Index: CMakeLists.txt
> ===================================================================
> --- CMakeLists.txt    (revision 26)
> +++ CMakeLists.txt    (working copy)
> @@ -4,6 +4,12 @@
>  
>  SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/etc/")
>  
> +# Use a debug postfix to distinguish build products. Mostly important on
> +# Windows, because linking a debug library into a release executable (or
> +# vice-versa, or just mixing C++ runtime versions) on Windows will lead
> +# to crashes if the libraries use the C++ runtime.
> +SET(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "Add a postfix, usually d on 
> windows")
> +
>  # On GCC, we need to set these compiler flags.
>  IF(NOT WIN32)
>       SET(CMAKE_CXX_FLAGS "-W -Wall -Wno-unused")
> @@ -27,6 +33,7 @@
>  )
>  
>  SET(HEADER_FILES
> +     ${osgCairo_SOURCE_DIR}/include/osgCairo/Export
>       ${osgCairo_SOURCE_DIR}/include/osgCairo/Glyph
>       ${osgCairo_SOURCE_DIR}/include/osgCairo/Image
>       ${osgCairo_SOURCE_DIR}/include/osgCairo/Matrix
> @@ -55,9 +62,28 @@
>  
>  ADD_LIBRARY(osgCairo SHARED ${SRC_FILES} ${HEADER_FILES})
>  
> -TARGET_LINK_LIBRARIES(osgCairo osg osgUtil osgViewer cairo)
> +# Add debug postfix to OSG libraries so we link to the right ones in debug.
> +# Cairo is a C-only library so the same one (release) can be linked to both
> +# debug and release without problems.
> +TARGET_LINK_LIBRARIES(osgCairo
> +                      debug     OpenThreads${CMAKE_DEBUG_POSTFIX}
> +                      optimized OpenThreads
> +                      debug     osg${CMAKE_DEBUG_POSTFIX}
> +                      optimized osg
> +                      debug     osgUtil${CMAKE_DEBUG_POSTFIX}
> +                      optimized osgUtil
> +                      debug     osgDB${CMAKE_DEBUG_POSTFIX}
> +                      optimized osgDB
> +                      debug     osgViewer${CMAKE_DEBUG_POSTFIX}
> +                      optimized osgViewer
> +                      general   cairo)
>  
> -INSTALL(TARGETS osgCairo DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
> +# The archive/runtime part is so that the lib/dll pair goes into lib and bin
> +# respectively on Windows.
> +INSTALL(TARGETS osgCairo
> +        ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
> +        LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
> +        RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
>  
>  FOREACH(INCLUDEFILE ${HEADER_FILES})
>       FILE(RELATIVE_PATH REL_INCLUDEFILE 
> ${osgCairo_SOURCE_DIR}/include/osgCairo ${INCLUDEFILE})
> Index: examples/osgcairomatrix/CMakeLists.txt
> ===================================================================
> --- examples/osgcairomatrix/CMakeLists.txt    (revision 26)
> +++ examples/osgcairomatrix/CMakeLists.txt    (working copy)
> @@ -1,7 +1,12 @@
>  PROJECT(osgcairomatrix)
>  
> -LINK_LIBRARIES(osgCairo)
> +# osgCairo gets the proper debug postfix automatically since it's part of the
> +# current project, but we need to add the postfix for the other libs.
> +LINK_LIBRARIES(osgCairo
> +               debug     OpenThreads${CMAKE_DEBUG_POSTFIX}
> +               optimized OpenThreads)
>  
>  ADD_EXECUTABLE(osgcairomatrix osgcairomatrix.cpp)
>  
>  INSTALL(TARGETS osgcairomatrix DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
> +SET_TARGET_PROPERTIES(osgcairomatrix PROPERTIES DEBUG_POSTFIX 
> ${CMAKE_DEBUG_POSTFIX})
> Index: examples/osgcairopdf/CMakeLists.txt
> ===================================================================
> --- examples/osgcairopdf/CMakeLists.txt       (revision 26)
> +++ examples/osgcairopdf/CMakeLists.txt       (working copy)
> @@ -1,7 +1,12 @@
>  PROJECT(osgcairopdf)
>  
> -LINK_LIBRARIES(osgCairo)
> +# osgCairo gets the proper debug postfix automatically since it's part of the
> +# current project, but we need to add the postfix for the other libs.
> +LINK_LIBRARIES(osgCairo
> +               debug     OpenThreads${CMAKE_DEBUG_POSTFIX}
> +               optimized OpenThreads)
>  
>  ADD_EXECUTABLE(osgcairopdf osgcairopdf.cpp)
>  
>  INSTALL(TARGETS osgcairopdf DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
> +SET_TARGET_PROPERTIES(osgcairopdf PROPERTIES DEBUG_POSTFIX 
> ${CMAKE_DEBUG_POSTFIX})
> Index: examples/osgcairoviewer/CMakeLists.txt
> ===================================================================
> --- examples/osgcairoviewer/CMakeLists.txt    (revision 26)
> +++ examples/osgcairoviewer/CMakeLists.txt    (working copy)
> @@ -1,7 +1,12 @@
>  PROJECT(osgcairoviewer)
>  
> -LINK_LIBRARIES(osgCairo)
> +# osgCairo gets the proper debug postfix automatically since it's part of the
> +# current project, but we need to add the postfix for the other libs.
> +LINK_LIBRARIES(osgCairo
> +               debug     OpenThreads${CMAKE_DEBUG_POSTFIX}
> +               optimized OpenThreads)
>  
>  ADD_EXECUTABLE(osgcairoviewer osgcairoviewer.cpp)
>  
>  INSTALL(TARGETS osgcairoviewer DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
> +SET_TARGET_PROPERTIES(osgcairoviewer PROPERTIES DEBUG_POSTFIX 
> ${CMAKE_DEBUG_POSTFIX})
> Index: examples/osgcairowidget/CMakeLists.txt
> ===================================================================
> --- examples/osgcairowidget/CMakeLists.txt    (revision 26)
> +++ examples/osgcairowidget/CMakeLists.txt    (working copy)
> @@ -1,7 +1,16 @@
>  PROJECT(osgcairowidget)
>  
> -LINK_LIBRARIES(osgCairo osgWidget)
> +# osgCairo gets the proper debug postfix automatically since it's part of the
> +# current project, but we need to add the postfix for the other libs.
> +LINK_LIBRARIES(osgCairo
> +               debug     OpenThreads${CMAKE_DEBUG_POSTFIX}
> +               optimized OpenThreads
> +               debug     osgGA${CMAKE_DEBUG_POSTFIX}
> +               optimized osgGA
> +               debug     osgWidget${CMAKE_DEBUG_POSTFIX}
> +               optimized osgWidget)
>  
>  ADD_EXECUTABLE(osgcairowidget osgcairowidget.cpp)
>  
>  INSTALL(TARGETS osgcairowidget DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
> +SET_TARGET_PROPERTIES(osgcairowidget PROPERTIES DEBUG_POSTFIX 
> ${CMAKE_DEBUG_POSTFIX})
> Index: include/osgCairo/Export
> ===================================================================
> --- include/osgCairo/Export   (revision 0)
> +++ include/osgCairo/Export   (revision 0)
> @@ -0,0 +1,16 @@
> +// -*-c++-*- osgCairo - Copyright (C) 2006 Jeremy Moles
> +
> +#ifndef __OSGCAIRO_EXPORT_H
> +#define __OSGCAIRO_EXPORT_H
> +
> +#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || 
> defined( __BCPLUSPLUS__)  || defined( __MWERKS__)
> +    #  if defined( osgCairo_EXPORTS )
> +    #    define OSGCAIRO_EXPORT   __declspec(dllexport)
> +    #  else
> +    #    define OSGCAIRO_EXPORT   __declspec(dllimport)
> +    #  endif
> +#else
> +    #  define OSGCAIRO_EXPORT
> +#endif  
> +
> +#endif  // OSGCAIRO_EXPORT
> Index: include/osgCairo/Glyph
> ===================================================================
> --- include/osgCairo/Glyph    (revision 26)
> +++ include/osgCairo/Glyph    (working copy)
> @@ -8,7 +8,7 @@
>  
>  namespace osgCairo {
>  
> -class Glyph: public CairoGlyph {
> +class OSGCAIRO_EXPORT Glyph: public CairoGlyph {
>  public:
>       Glyph(unsigned int _index = 0, double _x = 0.0f, double _y = 0.0f) {
>               setGlyph(_index, _x, _y);
> Index: include/osgCairo/Image
> ===================================================================
> --- include/osgCairo/Image    (revision 26)
> +++ include/osgCairo/Image    (working copy)
> @@ -8,7 +8,7 @@
>  
>  namespace osgCairo {
>  
> -class Image: public Surface, public osg::Image {
> +class OSGCAIRO_EXPORT Image: public Surface, public osg::Image {
>       bool        _allocated;
>       CairoFormat _format;
>  
> Index: include/osgCairo/Matrix
> ===================================================================
> --- include/osgCairo/Matrix   (revision 26)
> +++ include/osgCairo/Matrix   (working copy)
> @@ -9,7 +9,7 @@
>  
>  namespace osgCairo {
>  
> -class Matrix : public CairoMatrix, public osg::Referenced {
> +class OSGCAIRO_EXPORT Matrix : public CairoMatrix, public osg::Referenced {
>  public:
>       Matrix  (double=0.0f, double=0.0f, double=0.0f, double=0.0f, 
> double=0.0f, double=0.0f);
>       Matrix  (const CairoMatrix&);
> Index: include/osgCairo/Path
> ===================================================================
> --- include/osgCairo/Path     (revision 26)
> +++ include/osgCairo/Path     (working copy)
> @@ -10,7 +10,7 @@
>  
>  class Surface;
>       
> -class Path : public osg::Referenced {
> +class OSGCAIRO_EXPORT Path : public osg::Referenced {
>       friend class Surface;
>  
>       CairoPath* _path;
> Index: include/osgCairo/Pattern
> ===================================================================
> --- include/osgCairo/Pattern  (revision 26)
> +++ include/osgCairo/Pattern  (working copy)
> @@ -8,7 +8,7 @@
>  
>  namespace osgCairo {
>  
> -class Pattern : public osg::Referenced {
> +class OSGCAIRO_EXPORT Pattern : public osg::Referenced {
>  protected:
>       CairoPattern* _pattern;
>       
> @@ -32,22 +32,22 @@
>       CairoFilter getFilter ();
>  };
>  
> -class SolidPattern : public Pattern {
> +class OSGCAIRO_EXPORT SolidPattern : public Pattern {
>  public:
>       SolidPattern(double, double, double, double=1.0f);
>  };
>  
> -class SurfacePattern : public Pattern {
> +class OSGCAIRO_EXPORT SurfacePattern : public Pattern {
>  public:
>       SurfacePattern(CairoSurface*);
>  };
>  
> -class LinearPattern : public Pattern {
> +class OSGCAIRO_EXPORT LinearPattern : public Pattern {
>  public:
>       LinearPattern(double, double, double, double);
>  };
>  
> -class RadialPattern : public Pattern {
> +class OSGCAIRO_EXPORT RadialPattern : public Pattern {
>  public:
>       RadialPattern(double, double, double, double, double, double);
>  };
> Index: include/osgCairo/ReadFile
> ===================================================================
> --- include/osgCairo/ReadFile (revision 26)
> +++ include/osgCairo/ReadFile (working copy)
> @@ -9,7 +9,7 @@
>  
>  typedef std::vector<osg::ref_ptr<Image> > ImageVector;
>  
> -struct PDFOptions {
> +struct OSGCAIRO_EXPORT PDFOptions {
>       PDFOptions():
>       keepAspectRatio (true),
>       keepPageSize    (false),
> @@ -32,7 +32,7 @@
>  
>  // Reads every page of the PDF into a vector of osgCairo::Image objects, 
> rendered
>  // at the given resolution.
> -bool readFilePDF(const std::string&, ImageVector&, const PDFOptions& = 
> PDFOptions());
> +bool OSGCAIRO_EXPORT readFilePDF(const std::string&, ImageVector&, const 
> PDFOptions& = PDFOptions());
>  
>  } // namespace osgCairo
>  
> Index: include/osgCairo/ScaledFont
> ===================================================================
> --- include/osgCairo/ScaledFont       (revision 26)
> +++ include/osgCairo/ScaledFont       (working copy)
> @@ -7,7 +7,7 @@
>  
>  namespace osgCairo {
>  
> -class ScaledFont {
> +class OSGCAIRO_EXPORT ScaledFont {
>       CairoScaledFont* _scaledFont;
>  
>  public:
> Index: include/osgCairo/Surface
> ===================================================================
> --- include/osgCairo/Surface  (revision 26)
> +++ include/osgCairo/Surface  (working copy)
> @@ -13,7 +13,7 @@
>  
>  namespace osgCairo {
>  
> -class Surface {
> +class OSGCAIRO_EXPORT Surface {
>  protected:
>       CairoSurface* _surface;
>       CairoContext* _context;
> Index: include/osgCairo/Types
> ===================================================================
> --- include/osgCairo/Types    (revision 26)
> +++ include/osgCairo/Types    (working copy)
> @@ -5,6 +5,7 @@
>  
>  #include <string>
>  #include <cairo.h>
> +#include <osgCairo/Export>
>  
>  namespace osgCairo {
>  
> Index: src/Image.cpp
> ===================================================================
> --- src/Image.cpp     (revision 26)
> +++ src/Image.cpp     (working copy)
> @@ -170,7 +170,7 @@
>       
>       if(!kernel) return 0;
>  
> -     radiusf = fabs(radius) + 1.0f;
> +     radiusf = fabs(double(radius)) + 1.0f;
>  
>       if(deviation == 0.0f) 
>               deviation = sqrt (-(radiusf * radiusf) / (2.0f * log (1.0f / 
> 255.0f)))
> plain text document attachment (osgPango.patch)
> Index: CMakeLists.txt
> ===================================================================
> --- CMakeLists.txt    (revision 23)
> +++ CMakeLists.txt    (working copy)
> @@ -4,6 +4,12 @@
>  
>  SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/etc/")
>  
> +# Use a debug postfix to distinguish build products. Mostly important on
> +# Windows, because linking a debug library into a release executable (or
> +# vice-versa, or just mixing C++ runtime versions) on Windows will lead
> +# to crashes if the libraries use the C++ runtime.
> +SET(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "Add a postfix, usually d on 
> windows")
> +
>  # On GCC, we need to set these compiler flags.
>  IF(NOT WIN32)
>       SET(CMAKE_CXX_FLAGS "-W -Wall -Wno-unused")
> @@ -24,6 +30,7 @@
>  )
>  
>  SET(HEADER_FILES
> +     ${osgPango_SOURCE_DIR}/include/osgPango/Export
>       ${osgPango_SOURCE_DIR}/include/osgPango/Glyph
>       ${osgPango_SOURCE_DIR}/include/osgPango/Font
>       ${osgPango_SOURCE_DIR}/include/osgPango/Label
> @@ -35,11 +42,16 @@
>  
>  FIND_PACKAGE(OpenSceneGraph)
>  
> +# Modify these so that osgCairo headers and libs are found.
> +SET(OSGCAIRO_INCLUDE_DIR ../osgCairo/include CACHE STRING "Modify the path 
> if needed")
> +SET(OSGCAIRO_LIB_DIR     ../osgCairo/lib     CACHE STRING "Modify the path 
> if needed")
> +
>  INCLUDE_DIRECTORIES(include
>       ${OPENSCENEGRAPH_INCLUDE_DIR}
>       ${CAIRO_INCLUDE_DIRS}
>       ${PANGO_INCLUDE_DIRS}
>       ${PANGOCAIRO_INCLUDE_DIRS}
> +    ${OSGCAIRO_INCLUDE_DIR}
>  )
>  
>  LINK_DIRECTORIES(
> @@ -47,13 +59,41 @@
>       ${CAIRO_LIBRARY_DIRS}
>       ${PANGO_LIBRARY_DIRS}
>       ${PANGOCAIRO_LIBRARY_DIRS}
> +    ${OSGCAIRO_LIB_DIR}
>  )
>  
>  ADD_LIBRARY(osgPango SHARED ${SRC_FILES} ${HEADER_FILES})
>  
> -TARGET_LINK_LIBRARIES(osgPango osg osgUtil osgViewer osgCairo osgWidget 
> pango-1.0 pangocairo-1.0)
> +# Add debug postfix to OSG libraries so we link to the right ones in debug.
> +# Cairo, pango, pangocairo and the gtk libs are C-only libraries so the same
> +# one (release) can be linked to both debug and release without problems.
> +TARGET_LINK_LIBRARIES(osgPango
> +                      debug     OpenThreads${CMAKE_DEBUG_POSTFIX}
> +                      optimized OpenThreads
> +                      debug     osg${CMAKE_DEBUG_POSTFIX}
> +                      optimized osg
> +                      debug     osgUtil${CMAKE_DEBUG_POSTFIX}
> +                      optimized osgUtil
> +                      debug     osgText${CMAKE_DEBUG_POSTFIX}
> +                      optimized osgText
> +                      debug     osgViewer${CMAKE_DEBUG_POSTFIX}
> +                      optimized osgViewer
> +                      debug     osgWidget${CMAKE_DEBUG_POSTFIX}
> +                      optimized osgWidget
> +                      debug     osgCairo${CMAKE_DEBUG_POSTFIX}
> +                      optimized osgCairo
> +                      general   cairo
> +                      general   pango-1.0
> +                      general   pangocairo-1.0
> +                      general   gobject-2.0
> +                      general   glib-2.0)
>  
> -INSTALL(TARGETS osgPango DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
> +# The archive/runtime part is so that the lib/dll pair goes into lib and bin
> +# respectively on Windows.
> +INSTALL(TARGETS osgPango
> +        ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
> +        LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
> +        RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
>  
>  FOREACH(INCLUDEFILE ${HEADER_FILES})
>       FILE(RELATIVE_PATH REL_INCLUDEFILE 
> ${osgPango_SOURCE_DIR}/include/osgPango ${INCLUDEFILE})
> Index: examples/osgpangoanimation/CMakeLists.txt
> ===================================================================
> --- examples/osgpangoanimation/CMakeLists.txt (revision 23)
> +++ examples/osgpangoanimation/CMakeLists.txt (working copy)
> @@ -1,7 +1,12 @@
>  PROJECT(osgpangoanimation)
>  
> -LINK_LIBRARIES(osgPango)
> +# osgPango gets the proper debug postfix automatically since it's part of the
> +# current project, but we need to add the postfix for the other libs.
> +LINK_LIBRARIES(osgPango
> +               debug     OpenThreads${CMAKE_DEBUG_POSTFIX}
> +               optimized OpenThreads)
>  
>  ADD_EXECUTABLE(osgpangoanimation osgpangoanimation.cpp)
>  
>  INSTALL(TARGETS osgpangoanimation DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
> +SET_TARGET_PROPERTIES(osgpangoanimation PROPERTIES DEBUG_POSTFIX 
> ${CMAKE_DEBUG_POSTFIX})
> Index: examples/osgpangocustomrenderer/CMakeLists.txt
> ===================================================================
> --- examples/osgpangocustomrenderer/CMakeLists.txt    (revision 23)
> +++ examples/osgpangocustomrenderer/CMakeLists.txt    (working copy)
> @@ -1,7 +1,16 @@
>  PROJECT(osgpangocustomrenderer)
>  
> -LINK_LIBRARIES(osgPango)
> +# osgPango gets the proper debug postfix automatically since it's part of the
> +# current project, but we need to add the postfix for the other libs.
> +LINK_LIBRARIES(osgPango
> +               debug     OpenThreads${CMAKE_DEBUG_POSTFIX}
> +               optimized OpenThreads
> +               debug     osgGA${CMAKE_DEBUG_POSTFIX}
> +               optimized osgGA
> +               debug     osgDB${CMAKE_DEBUG_POSTFIX}
> +               optimized osgDB)
>  
>  ADD_EXECUTABLE(osgpangocustomrenderer osgpangocustomrenderer.cpp)
>  
>  INSTALL(TARGETS osgpangocustomrenderer DESTINATION 
> ${CMAKE_INSTALL_PREFIX}/bin)
> +SET_TARGET_PROPERTIES(osgpangocustomrenderer PROPERTIES DEBUG_POSTFIX 
> ${CMAKE_DEBUG_POSTFIX})
> Index: examples/osgpangofonts/CMakeLists.txt
> ===================================================================
> --- examples/osgpangofonts/CMakeLists.txt     (revision 23)
> +++ examples/osgpangofonts/CMakeLists.txt     (working copy)
> @@ -1,7 +1,12 @@
>  PROJECT(osgpangofonts)
>  
> -LINK_LIBRARIES(osgPango)
> +# osgPango gets the proper debug postfix automatically since it's part of the
> +# current project, but we need to add the postfix for the other libs.
> +LINK_LIBRARIES(osgPango
> +               debug     OpenThreads${CMAKE_DEBUG_POSTFIX}
> +               optimized OpenThreads)
>  
>  ADD_EXECUTABLE(osgpangofonts osgpangofonts.cpp)
>  
>  INSTALL(TARGETS osgpangofonts DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
> +SET_TARGET_PROPERTIES(osgpangofonts PROPERTIES DEBUG_POSTFIX 
> ${CMAKE_DEBUG_POSTFIX})
> Index: examples/osgpangoguiviewer/CMakeLists.txt
> ===================================================================
> --- examples/osgpangoguiviewer/CMakeLists.txt (revision 23)
> +++ examples/osgpangoguiviewer/CMakeLists.txt (working copy)
> @@ -1,7 +1,12 @@
>  PROJECT(osgpangoguiviewer)
>  
> -LINK_LIBRARIES(osgPango)
> +# osgPango gets the proper debug postfix automatically since it's part of the
> +# current project, but we need to add the postfix for the other libs.
> +LINK_LIBRARIES(osgPango
> +               debug     OpenThreads${CMAKE_DEBUG_POSTFIX}
> +               optimized OpenThreads)
>  
>  ADD_EXECUTABLE(osgpangoguiviewer osgpangoguiviewer.cpp)
>  
>  INSTALL(TARGETS osgpangoguiviewer DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
> +SET_TARGET_PROPERTIES(osgpangoguiviewer PROPERTIES DEBUG_POSTFIX 
> ${CMAKE_DEBUG_POSTFIX})
> Index: examples/osgpangoviewer/CMakeLists.txt
> ===================================================================
> --- examples/osgpangoviewer/CMakeLists.txt    (revision 23)
> +++ examples/osgpangoviewer/CMakeLists.txt    (working copy)
> @@ -1,7 +1,16 @@
>  PROJECT(osgpangoviewer)
>  
> -LINK_LIBRARIES(osgPango)
> +# osgPango gets the proper debug postfix automatically since it's part of the
> +# current project, but we need to add the postfix for the other libs.
> +LINK_LIBRARIES(osgPango
> +               debug     OpenThreads${CMAKE_DEBUG_POSTFIX}
> +               optimized OpenThreads
> +               debug     osgGA${CMAKE_DEBUG_POSTFIX}
> +               optimized osgGA
> +               debug     osgDB${CMAKE_DEBUG_POSTFIX}
> +               optimized osgDB)
>  
>  ADD_EXECUTABLE(osgpangoviewer osgpangoviewer.cpp)
>  
>  INSTALL(TARGETS osgpangoviewer DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
> +SET_TARGET_PROPERTIES(osgpangoviewer PROPERTIES DEBUG_POSTFIX 
> ${CMAKE_DEBUG_POSTFIX})
> Index: include/osgPango/Export
> ===================================================================
> --- include/osgPango/Export   (revision 0)
> +++ include/osgPango/Export   (revision 0)
> @@ -0,0 +1,16 @@
> +// -*-c++-*- osgPango - Copyright (C) 2008 Jeremy Moles
> +
> +#ifndef __OSGPANGO_EXPORT_H
> +#define __OSGPANGO_EXPORT_H
> +
> +#if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__) || 
> defined( __BCPLUSPLUS__)  || defined( __MWERKS__)
> +    #  if defined( osgPango_EXPORTS )
> +    #    define OSGPANGO_EXPORT   __declspec(dllexport)
> +    #  else
> +    #    define OSGPANGO_EXPORT   __declspec(dllimport)
> +    #  endif
> +#else
> +    #  define OSGPANGO_EXPORT
> +#endif  
> +
> +#endif  // OSGCAIRO_EXPORT
> Index: include/osgPango/Font
> ===================================================================
> --- include/osgPango/Font     (revision 23)
> +++ include/osgPango/Font     (working copy)
> @@ -11,7 +11,7 @@
>  
>  const std::string OSGPANGO_DEFAULT_FONT = "Sans 6";
>  
> -class Font: public osg::Referenced {
> +class OSGPANGO_EXPORT Font: public osg::Referenced {
>  public:
>       typedef std::list<std::string> FontList;
>  
> Index: include/osgPango/Glyph
> ===================================================================
> --- include/osgPango/Glyph    (revision 23)
> +++ include/osgPango/Glyph    (working copy)
> @@ -6,6 +6,7 @@
>  #include <map>
>  #include <osg/Geometry>
>  #include <osgCairo/Image>
> +#include <osgPango/Export>
>  
>  namespace osgPango {
>  
> @@ -14,7 +15,7 @@
>  const unsigned int DEFAULT_GCW = 512;
>  const unsigned int DEFAULT_GCH = 512;
>  
> -struct CachedGlyph {
> +struct OSGPANGO_EXPORT CachedGlyph {
>       CachedGlyph(
>               unsigned int     = 0,
>               const osg::Vec2& = osg::Vec2(),
> @@ -43,7 +44,7 @@
>  };
>  
>  // There is one GlyphCache object PER FONT object.
> -class GlyphCache: public osg::Referenced {
> +class OSGPANGO_EXPORT GlyphCache: public osg::Referenced {
>  public:
>       typedef std::map<unsigned int, CachedGlyph>                GlyphMap;
>       typedef std::vector<osg::ref_ptr<osgCairo::Image> > ImageVector;
> @@ -118,7 +119,7 @@
>       bool         _hasEffects;
>  };
>  
> -class GlyphGeometry: public osg::Geometry {
> +class OSGPANGO_EXPORT GlyphGeometry: public osg::Geometry {
>  public:
>       GlyphGeometry(bool = false);
>  
> @@ -135,7 +136,7 @@
>  
>  typedef std::vector<GlyphGeometry*> GlyphGeometryVector;
>  
> -class GlyphCacheOutline: public GlyphCache {
> +class OSGPANGO_EXPORT GlyphCacheOutline: public GlyphCache {
>  public:
>       GlyphCacheOutline(unsigned int, unsigned int, unsigned int = 2);
>  
> @@ -159,7 +160,7 @@
>       unsigned int _outline;
>  };
>  
> -class GlyphCacheShadowOffset: public GlyphCache {
> +class OSGPANGO_EXPORT GlyphCacheShadowOffset: public GlyphCache {
>  public:
>       GlyphCacheShadowOffset(unsigned int, unsigned int, int = 1, int = 1);
>  
> @@ -184,7 +185,7 @@
>       int _yOffset;
>  };
>  
> -class GlyphCacheShadowGaussian: public GlyphCache {
> +class OSGPANGO_EXPORT GlyphCacheShadowGaussian: public GlyphCache {
>  public:
>       GlyphCacheShadowGaussian(unsigned int, unsigned int, unsigned int);
>  
> Index: include/osgPango/Label
> ===================================================================
> --- include/osgPango/Label    (revision 23)
> +++ include/osgPango/Label    (working copy)
> @@ -8,13 +8,13 @@
>  
>  namespace osgPango {
>  
> -class Label: public Layout, public osgWidget::Widget {
> +class OSGPANGO_EXPORT Label: public Layout, public osgWidget::Widget {
>  public:
>       META_Object(osgPango, Label);
>  
>       Label(
> -             const std::string&,
> -             const std::string&,
> +             const std::string& = "",
> +             const std::string& = "",
>               Font*              = 0,
>               GlyphEffectsMethod = GLYPH_EFFECTS_METHOD_DEFAULT
>       );
> @@ -26,13 +26,13 @@
>  
>       virtual bool textUpdated(GlyphGeometryVector&);
>  
> -     virtual void parented   (Window*);
> -     virtual void unparented (Window*);
> +    virtual void parented   (osgWidget::Window*);
> +     virtual void unparented (osgWidget::Window*);
>       virtual void positioned ();
>  
>  protected:
> -     void _setDrawables     ();
> -     void _removesDrawables ();
> +     void _setDrawables    ();
> +     void _removeDrawables ();
>  
>       bool _textUpdated;
>       
> Index: include/osgPango/Layout
> ===================================================================
> --- include/osgPango/Layout   (revision 23)
> +++ include/osgPango/Layout   (working copy)
> @@ -11,19 +11,19 @@
>  
>  class Layout;
>  
> -struct Renderer {
> +struct OSGPANGO_EXPORT Renderer {
>       PangoRenderer parent_instance;
>       Layout*       text;
>  };
>  
> -struct RendererClass {
> +struct OSGPANGO_EXPORT RendererClass {
>       PangoRendererClass class_instance;
>  };
>  
>  // We only inherit from Referenced here for convenience, it's not necessary. 
>  // In fact, there may be some complications with multiple inheritance and 
> objects
>  // inheriting from the same base.
> -class Layout: public osg::Referenced {
> +class OSGPANGO_EXPORT Layout: public osg::Referenced {
>  public:
>       enum Alignment {
>               ALIGN_LEFT,
> Index: include/osgPango/Text
> ===================================================================
> --- include/osgPango/Text     (revision 23)
> +++ include/osgPango/Text     (working copy)
> @@ -8,7 +8,7 @@
>  
>  namespace osgPango {
>  
> -class Text: public Layout, public osg::Geode {
> +class OSGPANGO_EXPORT Text: public Layout, public osg::Geode {
>  public:
>       Text(Font* font = 0, GlyphEffectsMethod gem = 
> GLYPH_EFFECTS_METHOD_DEFAULT):
>       Layout(font, gem) {
> Index: src/Label.cpp
> ===================================================================
> --- src/Label.cpp     (revision 23)
> +++ src/Label.cpp     (working copy)
> @@ -1,10 +1,11 @@
>  // -*-c++-*- osgPango - Copyright (C) 2008 Jeremy Moles
>  
>  #include <osgPango/Label>
> +#include <osgWidget/Window>
>  
>  namespace osgPango {
>  
> -Label(
> +Label::Label(
>       const std::string& name,
>       const std::string& label,
>       Font*              font,
> @@ -18,7 +19,7 @@
>  Label::Label(const Label& label, const osg::CopyOp& co) {
>  }
>  
> -virtual bool Label::textUpdated(GlyphGeometryVector& ggv) {
> +bool Label::textUpdated(GlyphGeometryVector& ggv) {
>       // TODO: Get our parent and call allDrawable(), just like text. Get
>       // the index for future use.
>       if(!_parent) {
> @@ -32,7 +33,7 @@
>       return true;
>  }
>  
> -void Label::parented(Window* parent) {
> +void Label::parented(osgWidget::Window* parent) {
>       if(_textUpdated) {
>               _textUpdated = false;
>  
> @@ -40,7 +41,7 @@
>       }
>  }
>  
> -void Label::unparented(Window* parent) {
> +void Label::unparented(osgWidget::Window* parent) {
>       _removeDrawables();
>  }
>  
> plain text document attachment (osgcairomatrix.txt)
> Identity 
> 1 0
> 0 1
> 0 0
> Translate 
> 1 0
> 0 1
> 20 20
> Scale 
> 10 0
> 0 10
> 0 0
> Rotate 
> -1 1.22461e-016
> -1.22461e-016 -1
> 0 0
> plain text document attachment (osgpangofonts.txt)
> Found 119 font families.
> MingLiU_HKSCS (Normal, Italic)
> monospace (Normal, Normal, Normal, Italic, Bold, Bold Italic, Normal, Normal, 
> Normal, Normal, Normal, Normal, Normal, Normal, Normal, Normal, Normal, 
> Normal, Normal, Normal, Normal, Italic, Bold, Bold Italic, Bold Italic, 
> Normal, Bold, Italic, Italic, Italic, Italic, Italic, Italic, Italic, Italic, 
> Italic, Italic, Italic, Italic, Italic, Italic, Italic, Italic, Italic)
> Lucida Console (Normal, Italic)
> MS Mincho (Normal, Italic)
> BatangChe (Normal, Italic)
> David (Normal, Bold, Bold Italic, Italic)
> Euphemia (Normal, Italic)
> DejaVu Sans Mono (Bold Italic, Normal, Bold, Italic)
> MoolBoran (Normal, Italic)
> DejaVu Sans Condensed (Bold Italic, Bold, Normal, Italic)
> OpenSymbol (Normal, Italic)
> Nina (Normal, Bold, Bold Italic, Italic)
> DejaVu Serif Condensed (Bold Italic, Bold, Normal, Italic)
> Georgia (Normal, Italic, Bold, Bold Italic)
> Kartika (Normal, Italic)
> Microsoft JhengHei (Normal, Bold, Bold Italic, Italic)
> courier (Normal, Italic, Bold, Bold Italic)
> KaiTi (Normal, Italic)
> Nyala (Normal, Italic)
> Rod (Normal, Italic)
> Courier New (Normal, Italic, Bold, Bold Italic)
> NSimSun (Normal, Italic)
> Browallia New (Normal, Italic, Bold, Bold Italic)
> CordiaUPC (Normal, Bold, Bold Italic, Italic)
> DejaVu Serif (Bold, Normal, Bold Italic, Italic)
> LilyUPC (Normal, Italic, Bold, Bold Italic)
> Batang (Normal, Italic)
> JasmineUPC (Normal, Italic, Bold, Bold Italic)
> MingLiU-ExtB (Normal, Italic)
> Mongolian Baiti (Normal, Italic)
> Miriam (Normal, Italic)
> MingLiU_HKSCS-ExtB (Normal, Italic)
> Gulim (Normal, Italic)
> Microsoft Uighur (Normal, Italic)
> Segoe UI (Normal, Bold, Italic, Bold Italic)
> Impact (Normal, Italic)
> sans (Normal, Italic, Bold, Bold Italic, Normal, Normal, Normal, Normal, 
> Normal, Normal, Normal, Bold, Normal, Italic, Bold, Bold Italic, Normal, 
> Bold, Normal, Bold, Normal, Normal, Normal, Bold, Normal, Bold, Italic, Bold 
> Italic, Normal, Normal, Bold, Normal, Normal, Italic, Bold, Bold Italic, 
> Normal, Bold, Normal, Bold, Normal, Normal, Bold, Normal, Normal, Normal, 
> Normal, Italic, Bold, Bold Italic, Normal, Italic, Bold, Bold Italic, Normal, 
> Bold, Bold Italic, Italic, Normal, Italic, Bold, Bold Italic, Normal, Italic, 
> Bold, Bold Italic, Normal, Italic, Bold, Bold Italic, Normal, Heavy, Normal, 
> Italic, Bold, Bold Italic, Normal, Italic, Bold, Bold Italic, Normal, Italic, 
> Bold, Bold Italic, Normal, Italic, Normal, Italic, Bold, Bold Italic, Normal, 
> Italic, Bold, Bold Italic, Normal, Bold, Bold, Bold Italic, Normal, Italic, 
> Bold Italic, Bold, Normal, Italic, Ultra-Light, Italic, Heavy Italic, Italic, 
> Italic, Italic, Bold Italic, Italic, Bold Italic, Bold Italic, Italic, Bold 
> Italic, Italic, Italic, Italic, Italic, Italic, Italic, Bold Italic, Italic, 
> Italic, Italic, Italic, Italic, Italic, Italic, Italic, Italic, Bold Italic, 
> Ultra-Light Italic, Bold Italic, Italic, Bold Italic, Bold Italic, Italic, 
> Italic)
> Mangal (Normal, Italic)
> Calibri (Normal, Italic, Bold, Bold Italic)
> Gautami (Normal, Italic)
> MV Boli (Normal, Italic)
> Cambria Math (Normal, Italic)
> Cambria (Normal, Italic, Bold, Bold Italic)
> Microsoft Yi Baiti (Normal, Italic)
> Microsoft YaHei (Normal, Bold, Italic, Bold Italic)
> Iskoola Pota (Normal, Italic)
> Angsana New (Normal, Italic, Bold, Bold Italic)
> Miriam Fixed (Normal, Italic)
> Aharoni (Bold, Bold Italic)
> DejaVu Sans Light (Ultra-Light, Ultra-Light Italic)
> Traditional Arabic (Normal, Bold, Italic, Bold Italic)
> Plantagenet Cherokee (Normal, Italic)
> DilleniaUPC (Normal, Italic, Bold, Bold Italic)
> Gungsuh (Normal, Italic)
> Segoe Script (Normal, Bold, Italic, Bold Italic)
> Arial (Normal, Italic, Bold, Bold Italic)
> FreesiaUPC (Normal, Italic, Bold, Bold Italic)
> augie (Normal, Italic)
> Kalinga (Normal, Italic)
> IrisUPC (Normal, Italic, Bold, Bold Italic)
> Malgun Gothic (Normal, Bold, Bold Italic, Italic)
> SimHei (Normal, Italic)
> Trebuchet MS (Normal, Italic, Bold, Bold Italic)
> Gisha (Normal, Bold, Bold Italic, Italic)
> Arial Black (Heavy, Heavy Italic)
> Comic Sans MS (Normal, Bold, Bold Italic, Italic)
> Franklin Gothic Medium (Normal, Italic)
> Verdana (Normal, Italic, Bold, Bold Italic)
> PMingLiU-ExtB (Normal, Italic)
> Raavi (Normal, Italic)
> Candara (Normal, Italic, Bold, Bold Italic)
> SimSun (Normal, Italic)
> Microsoft Himalaya (Normal, Italic)
> Vrinda (Normal, Italic)
> Cordia New (Normal, Italic, Bold, Bold Italic)
> KodchiangUPC (Normal, Italic, Bold, Bold Italic)
> Estrangelo Edessa (Normal, Italic)
> Arabic Typesetting (Normal, Italic)
> DFKai-SB (Normal, Italic)
> DejaVu Sans (Bold, Bold Italic, Normal, Italic)
> DokChampa (Normal, Italic)
> Simplified Arabic Fixed (Normal, Italic)
> Meiryo (Normal, Italic, Bold, Bold Italic)
> DotumChe (Normal, Italic)
> FangSong (Normal, Italic)
> Andalus (Normal, Italic)
> Constantia (Normal, Italic, Bold, Bold Italic)
> AngsanaUPC (Normal, Italic, Bold, Bold Italic)
> FrankRuehl (Normal, Italic)
> Segoe Print (Normal, Bold, Bold Italic, Italic)
> PMingLiU (Normal, Italic)
> Microsoft Sans Serif (Normal, Italic)
> Dotum (Normal, Italic)
> Corbel (Normal, Italic, Bold, Bold Italic)
> Tahoma (Normal, Bold, Bold Italic, Italic)
> GungsuhChe (Normal, Italic)
> EucrosiaUPC (Normal, Italic, Bold, Bold Italic)
> GulimChe (Normal, Italic)
> Times New Roman (Normal, Italic, Bold, Bold Italic)
> Latha (Normal, Italic)
> Tunga (Normal, Italic)
> MS PGothic (Normal, Italic)
> BrowalliaUPC (Normal, Italic, Bold, Bold Italic)
> Shruti (Normal, Italic)
> MingLiU (Normal, Italic)
> Simplified Arabic (Normal, Bold, Bold Italic, Italic)
> Consolas (Normal, Italic, Bold, Bold Italic)
> Sylfaen (Normal, Italic)
> Lucida Sans Unicode (Normal, Italic)
> serif (Normal, Normal, Normal, Normal, Normal, Normal, Normal, Normal, 
> Normal, Normal, Normal, Normal, Normal, Normal, Italic, Bold, Bold Italic, 
> Normal, Italic, Bold, Bold Italic, Normal, Italic, Bold, Bold Italic, Normal, 
> Italic, Bold, Bold Italic, Normal, Italic, Bold, Bold Italic, Normal, Italic, 
> Bold, Bold Italic, Normal, Italic, Bold, Bold Italic, Normal, Italic, Bold, 
> Bold Italic, Normal, Normal, Italic, Bold, Bold Italic, Normal, Italic, Bold, 
> Bold Italic, Normal, Italic, Bold, Bold Italic, Bold, Normal, Bold Italic, 
> Italic, Bold Italic, Bold, Normal, Italic, Italic, Italic, Italic, Italic, 
> Italic, Italic, Italic, Italic, Italic, Italic, Italic, Italic, Italic, 
> Italic)
> Leelawadee (Normal, Bold, Bold Italic, Italic)
> Narkisim (Normal, Italic)
> MS PMincho (Normal, Italic)
> Levenim MT (Normal, Bold, Bold Italic, Italic)
> Palatino Linotype (Normal, Italic, Bold, Bold Italic)
> MS UI Gothic (Normal, Italic)
> MS Gothic (Normal, Italic)
> DaunPenh (Normal, Italic)
> SimSun-ExtB (Normal, Italic)
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to