Skip to content

Building with the latest SDL_ttf #12

@mehdisadeghi

Description

@mehdisadeghi

Hi there,

I am trying to build the app with the latest version of SDL_ttf with HarfBuzz flag set. I can build the app normally, but not with the latest version. So far I have tried the following and failed.

After running ./gradlew downloadDependencies, I replaced the contents of SDL2_ttf/SDL2_ttf folder with the latest copy of SDL2_ttf and then took the following steps.

First I tried to use the Android.mk inside the SDL2_ttf directory. So I changed the main app/src/main/cpp/CMakeLists.txt and added add_subdirectory( SDL2_ttf/SDL2_ttf ) to it. I also manually modifed the Android.mk and set SUPPORT_HARFBUZZ to true. The app builds but apparently the HarfBuzz support is missing.

Then I tried to modify app/src/main/cpp/SDL2_ttf/CMakeLists.txt and add the necessary cmake code to build harfbuzz (which is included in the source tree of the latest SDL_ttf):


include_directories( "${HARFBUZZ_DIR}/src/" )
include_directories( "${HARFBUZZ_DIR}/src/hb-ucdn/" )

add_definitions("-DTTF_USE_HARFBUZZ=1")
add_definitions("-DHAVE_UCDN=1")

set( SOURCES
        "${HARFBUZZ_DIR}/src/hb-blob.cc"
        "${HARFBUZZ_DIR}/src/hb-buffer-serialize.cc"
        "${HARFBUZZ_DIR}/src/hb-face.cc"
        "${HARFBUZZ_DIR}/src/hb-ot-tag.cc"
        "${HARFBUZZ_DIR}/src/hb-buffer.cc"
        "${HARFBUZZ_DIR}/src/hb-font.cc"
        "${HARFBUZZ_DIR}/src/hb-common.cc"
        "${HARFBUZZ_DIR}/src/hb-set.cc"
        "${HARFBUZZ_DIR}/src/hb-shape-plan.cc"
        "${HARFBUZZ_DIR}/src/hb-ot-font.cc"
        "${HARFBUZZ_DIR}/src/hb-shaper.cc"
        "${HARFBUZZ_DIR}/src/hb-unicode.cc"
        "${HARFBUZZ_DIR}/src/hb-ot-shape.cc"
        "${HARFBUZZ_DIR}/src/hb-ot-face.cc"
        "${HARFBUZZ_DIR}/src/hb-shape.cc"
        "${HARFBUZZ_DIR}/src/hb-static.cc"
        "${HARFBUZZ_DIR}/src/hb-warning.cc"
        "${HARFBUZZ_DIR}/src/hb-ot-shape-complex-default.cc"
        "${HARFBUZZ_DIR}/src/hb-ot-layout.cc"
        "${HARFBUZZ_DIR}/src/hb-ot-math.cc"
        "${HARFBUZZ_DIR}/src/hb-ot-map.cc"
        "${HARFBUZZ_DIR}/src/hb-ot-shape-complex-arabic.cc"
        "${HARFBUZZ_DIR}/src/hb-ot-shape-complex-hangul.cc"
        "${HARFBUZZ_DIR}/src/hb-ot-shape-complex-hebrew.cc"
        "${HARFBUZZ_DIR}/src/hb-ot-shape-complex-indic.cc"
        "${HARFBUZZ_DIR}/src/hb-ot-shape-complex-indic-table.cc"
        "${HARFBUZZ_DIR}/src/hb-ot-shape-complex-khmer.cc"
        "${HARFBUZZ_DIR}/src/hb-ot-shape-complex-myanmar.cc"
        "${HARFBUZZ_DIR}/src/hb-ot-shape-complex-thai.cc"
        "${HARFBUZZ_DIR}/src/hb-ot-shape-complex-use.cc"
        "${HARFBUZZ_DIR}/src/hb-ot-shape-complex-use-table.cc"
        "${HARFBUZZ_DIR}/src/hb-ot-shape-normalize.cc"
        "${HARFBUZZ_DIR}/src/hb-fallback-shape.cc"
        "${HARFBUZZ_DIR}/src/hb-ot-shape-fallback.cc"
        "${HARFBUZZ_DIR}/src/hb-ot-shape-complex-vowel-constraints.cc"
        "${HARFBUZZ_DIR}/src/hb-ot-var.cc"
        "${HARFBUZZ_DIR}/src/hb-ot-cff1-table.cc"
        "${HARFBUZZ_DIR}/src/hb-ot-cff2-table.cc"
        "${HARFBUZZ_DIR}/src/hb-ft.cc"
        "${HARFBUZZ_DIR}/src/hb-ucdn.cc"
        "${HARFBUZZ_DIR}/src/hb-ucdn/ucdn.c"
        "${HARFBUZZ_DIR}/src/hb-aat-layout.cc"
        "${HARFBUZZ_DIR}/src/hb-aat-map.cc" )

add_library( harfbuzz STATIC ${SOURCES} )

#----------------
# Build SDL_ttf
#----------------

add_library( SDL2_ttf SHARED SDL2_ttf/SDL_ttf.c )
target_link_libraries( SDL2_ttf
                        SDL2
                        freetype 
                        harfbuzz)

This didn't work either. I made a dummy PR just to demonstrate the changes. This is necessary in order to be able to proceed with our short discussion over INSTEAD.

I'd appreciate any feedback on this.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions