[dwrite] Use new again and enable the build on msys2 bots (#890)
This commit is contained in:
parent
8d1b4082ae
commit
957e775663
@ -20,11 +20,11 @@ environment:
|
||||
|
||||
|
||||
- compiler: msys2
|
||||
MINGW_PREFIX: /c/msys2/mingw64/
|
||||
MINGW_PREFIX: /mingw64
|
||||
MINGW_CHOST: x86_64-w64-mingw32
|
||||
MSYS2_ARCH: x86_64
|
||||
- compiler: msys2
|
||||
MINGW_PREFIX: /c/msys2/mingw32/
|
||||
MINGW_PREFIX: /mingw32
|
||||
MINGW_CHOST: i686-w64-mingw32
|
||||
MSYS2_ARCH: i686
|
||||
|
||||
@ -44,7 +44,8 @@ build_script:
|
||||
- 'if "%compiler%"=="msvc" if not "%platform%"=="ARM" ctest --output-on-failure -C %configuration%'
|
||||
|
||||
- 'if "%compiler%"=="msys2" C:\msys64\usr\bin\bash -lc "pacman --noconfirm -S mingw-w64-$MSYS2_ARCH-{freetype,cairo,icu,gettext,gobject-introspection,gcc,gcc-libs,glib2,graphite2,pkg-config,python2}"'
|
||||
- 'if "%compiler%"=="msys2" C:\msys64\usr\bin\bash -lc "cd $APPVEYOR_BUILD_FOLDER; PATH=$PATH:/mingw64/bin:/mingw32/bin; ./autogen.sh --with-uniscribe --with-freetype --with-glib --with-gobject --with-cairo --with-icu --with-graphite2 --build=%MINGW_CHOST% --host=%MINGW_CHOST% --prefix=%MINGW_PREFIX%; make; make check || .ci/fail.sh"'
|
||||
- 'if "%compiler%"=="msys2" C:\msys64\usr\bin\bash -lc "curl https://sourceforge.net/p/mingw-w64/mingw-w64/ci/master/tree/mingw-w64-headers/include/dwrite_1.h?format=raw > %MINGW_PREFIX%/%MINGW_CHOST%/include/dwrite_1.h"'
|
||||
- 'if "%compiler%"=="msys2" C:\msys64\usr\bin\bash -lc "cd $APPVEYOR_BUILD_FOLDER; PATH=$PATH:/mingw64/bin:/mingw32/bin; ./autogen.sh --with-uniscribe --with-freetype --with-glib --with-gobject --with-cairo --with-icu --with-graphite2 --with-directwrite --build=%MINGW_CHOST% --host=%MINGW_CHOST% --prefix=%MINGW_PREFIX%; make; make check || .ci/fail.sh"'
|
||||
|
||||
cache:
|
||||
- c:\tools\vcpkg\installed\
|
||||
|
@ -48,7 +48,7 @@ class DWriteFontFileLoader : public IDWriteFontFileLoader
|
||||
private:
|
||||
IDWriteFontFileStream *mFontFileStream;
|
||||
public:
|
||||
void init (IDWriteFontFileStream *fontFileStream)
|
||||
DWriteFontFileLoader (IDWriteFontFileStream *fontFileStream)
|
||||
{
|
||||
mFontFileStream = fontFileStream;
|
||||
}
|
||||
@ -74,7 +74,7 @@ private:
|
||||
uint8_t *mData;
|
||||
uint32_t mSize;
|
||||
public:
|
||||
void init (uint8_t *aData, uint32_t aSize)
|
||||
DWriteFontFileStream (uint8_t *aData, uint32_t aSize)
|
||||
{
|
||||
mData = aData;
|
||||
mSize = aSize;
|
||||
@ -151,14 +151,11 @@ _hb_directwrite_shaper_face_data_create(hb_face_t *face)
|
||||
|
||||
HRESULT hr;
|
||||
hb_blob_t *blob = hb_face_reference_blob (face);
|
||||
DWriteFontFileStream *fontFileStream = (DWriteFontFileStream*)
|
||||
malloc (sizeof (DWriteFontFileStream));
|
||||
fontFileStream->init ((uint8_t*) hb_blob_get_data (blob, nullptr),
|
||||
DWriteFontFileStream *fontFileStream = new DWriteFontFileStream (
|
||||
(uint8_t *) hb_blob_get_data (blob, nullptr),
|
||||
hb_blob_get_length (blob));
|
||||
|
||||
DWriteFontFileLoader *fontFileLoader = (DWriteFontFileLoader*)
|
||||
malloc (sizeof (DWriteFontFileLoader));
|
||||
fontFileLoader->init (fontFileStream);
|
||||
DWriteFontFileLoader *fontFileLoader = new DWriteFontFileLoader (fontFileStream);
|
||||
dwriteFactory->RegisterFontFileLoader (fontFileLoader);
|
||||
|
||||
IDWriteFontFile *fontFile;
|
||||
@ -216,9 +213,9 @@ _hb_directwrite_shaper_face_data_destroy(hb_directwrite_shaper_face_data_t *data
|
||||
data->dwriteFactory->Release ();
|
||||
}
|
||||
if (data->fontFileLoader)
|
||||
free (data->fontFileLoader);
|
||||
delete data->fontFileLoader;
|
||||
if (data->fontFileStream)
|
||||
free (data->fontFileStream);
|
||||
delete data->fontFileStream;
|
||||
if (data->faceBlob)
|
||||
hb_blob_destroy (data->faceBlob);
|
||||
if (data)
|
||||
@ -924,7 +921,7 @@ hb_directwrite_shape_experimental_width(hb_font_t *font,
|
||||
unsigned int num_features,
|
||||
float width)
|
||||
{
|
||||
static char *shapers = (char *) "directwrite";
|
||||
static const char *shapers = "directwrite";
|
||||
hb_shape_plan_t *shape_plan = hb_shape_plan_create_cached (font->face,
|
||||
&buffer->props, features, num_features, &shapers);
|
||||
hb_bool_t res = _hb_directwrite_shape_full (shape_plan, font, buffer,
|
||||
|
Loading…
Reference in New Issue
Block a user