mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-11 13:38:35 +00:00
Merge pull request #496 from dbr/freetype
This commit is contained in:
commit
bde35e9f3f
@ -61,6 +61,8 @@ with the exception of the current default winit feature/dep version. Additionall
|
||||
- If you're using `DEP_IMGUI_DEFINE_`s for this already, then no change is needed.
|
||||
- If you're using `.cargo/config` to apply a build script override and link against a prebuilt `Dear Imgui` (or something else along these lines), you need to ensure you link with a version that was built using `-DIMGUI_USE_WCHAR32`.
|
||||
|
||||
- Support for the freetype font rasterizer. Enabled by the non-default `freetype` feature, e.g `imgui = {version = "...", features=["freetype"]})`
|
||||
|
||||
## [0.7.0] - 2021-02-04
|
||||
|
||||
- Upgrade to [Dear ImGui v1.80](https://github.com/ocornut/imgui/releases/tag/v1.80). (Note that the new table functionality is not yet supported, however)
|
||||
|
||||
@ -47,6 +47,7 @@ Window::new(im_str!("Hello world"))
|
||||
for more information and justification for this design.
|
||||
- Easy integration with Glium / pre-ll gfx (renderer)
|
||||
- Easy integration with winit (backend platform)
|
||||
- Optional support for the freetype font rasterizer
|
||||
|
||||
## Choosing a backend platform and a renderer
|
||||
|
||||
|
||||
@ -18,7 +18,9 @@ chlorine = "1.0.7"
|
||||
|
||||
[build-dependencies]
|
||||
cc = "1.0"
|
||||
pkg-config = { version="0.3", optional=true }
|
||||
|
||||
[features]
|
||||
default = []
|
||||
wasm = []
|
||||
freetype = ["pkg-config"]
|
||||
|
||||
@ -48,6 +48,20 @@ fn main() -> io::Result<()> {
|
||||
build.define(key, *value);
|
||||
}
|
||||
|
||||
// Freetype font rasterizer feature
|
||||
#[cfg(feature = "freetype")]
|
||||
{
|
||||
let freetype = pkg_config::Config::new().find("freetype2").unwrap();
|
||||
for include in freetype.include_paths.iter() {
|
||||
build.include(include);
|
||||
}
|
||||
build.define("IMGUI_ENABLE_FREETYPE", None);
|
||||
println!("cargo:DEFINE_IMGUI_ENABLE_FREETYPE=");
|
||||
|
||||
// imgui_freetype.cpp needs access to imgui.h
|
||||
build.include(manifest_dir.join("third-party/imgui/"));
|
||||
}
|
||||
|
||||
let compiler = build.get_compiler();
|
||||
// Avoid the if-supported flag functions for easy cases, as they're
|
||||
// kinda costly.
|
||||
|
||||
@ -9,4 +9,8 @@
|
||||
#include "./third-party/imgui/imgui_tables.cpp"
|
||||
#include "./third-party/cimgui.cpp"
|
||||
|
||||
#ifdef IMGUI_ENABLE_FREETYPE
|
||||
#include "./third-party/imgui/misc/freetype/imgui_freetype.cpp"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@ -19,6 +19,7 @@ parking_lot = "0.11"
|
||||
|
||||
[features]
|
||||
wasm = ["imgui-sys/wasm"]
|
||||
freetype = ["imgui-sys/freetype"]
|
||||
|
||||
[dev-dependencies]
|
||||
memoffset = "0.6"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user