Skip to content

Commit 528e41c

Browse files
committed
Release 4.3, linux support (including for embedded font creation)
1 parent f8f7971 commit 528e41c

7 files changed

Lines changed: 43 additions & 4 deletions

File tree

.idea/misc.xml

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tcMenuGenerator/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@
249249
<includes>
250250
<include>mac/*.dylib</include>
251251
<include>win/*.dll</include>
252-
<!--include>ubu/*.so</include-->
252+
<include>ubu/*.so</include>
253253
</includes>
254254
<filtering>false</filtering>
255255
</resource>

tcMenuGenerator/src/main/java/com/thecoderscorner/menu/editorui/util/TcNativeLibrary.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,11 @@ private static void loadLibrary() {
7979
} else if(os != null && os.startsWith("Win")) {
8080
var path = DefaultXmlPluginLoader.findPluginDir().resolve("win").resolve("tcMenuNative.dll");
8181
System.load(path.toString());
82+
} else if(os != null && os.startsWith("Linux")) {
83+
var path = DefaultXmlPluginLoader.findPluginDir().resolve("ubu").resolve("libtcMenuNative.so");
84+
System.load(path.toString());
8285
}
83-
// Linux to follow in another PR shortly
86+
8487
}
8588

8689
public static TcNativeLibrary getInstance() {

tcMenuNative/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,13 @@ endif()
2121
add_library(tcMenuNative SHARED library.cpp FreeFontHandler.cpp)
2222

2323
# Pull in the free type headers.
24-
target_include_directories(tcMenuNative PRIVATE ${FREETYPE_DIR})
24+
if(UNIX AND NOT APPLE)
25+
# I don't like this but for now we need to do this as the find_package doesn't
26+
# correctly locate the includes.
27+
target_include_directories(tcMenuNative PRIVATE /usr/include/freetype2)
28+
else ()
29+
target_include_directories(tcMenuNative PRIVATE ${FREETYPE_DIR})
30+
endif ()
2531

2632
if(UNIX)
2733
# On unix we need to link against the three libraries needed by freetype, these were found above using find_package

tcMenuNative/FreeFontHandler.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44
#include <vector>
55
#include <map>
66
#include "library.h"
7+
#if __has_include ("freetype/freetype.h")
78
#include "freetype/freetype.h"
9+
#else
10+
#include "freetype2/freetype/freetype.h"
11+
#endif // free type include
812

913
class FreeFontHandler;
1014

tcMenuNative/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# TcMenuNative wrapper library
2+
3+
This directory contains a small wrapper around freetype that has been tested on Windows, MacOS and also Ubuntu. It should be fairly easy to get this to compile on any platform that the underlying library supports.
4+
5+
Once you've built a release build, it is your responsibility to test it, and that includes running TcMenu to ensure the font creator is working properly. Try importing fonts, with different unicode ranges etc. Ensure they look bit perfect.
6+
7+
Once it is tested, replace the output DLL/DynLib/so file in the packaged directory.
8+
9+
## Windows
10+
11+
Use the Visual Studio toolchain as the dependencies it creates are on nearly all Windows boxes.
12+
13+
First you need a statically linked version of the freetype library, this is generally achieved by building the free type source with the static linking options enabled.
14+
15+
## MacOS
16+
17+
Ensure XCode is installed. Beyond this the library should build in release mode with no further options
18+
19+
## Linux Ubuntu
20+
21+
Ensure you have the following package installed.
22+
23+
sudo apt-get install libfreetype6-dev
24+
25+
Beyond this a release build should work.
26.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)