fix fontdue version everywhere

This commit is contained in:
Matthieu Baumann
2022-03-14 17:47:03 +01:00
parent 65d1e8d73d
commit dfdfcda003
7 changed files with 16 additions and 15 deletions

View File

@@ -8,7 +8,7 @@
"serve": "webpack-dev-server"
},
"devDependencies": {
"@wasm-tool/wasm-pack-plugin": "^1.0.1",
"@wasm-tool/wasm-pack-plugin": "^1.6.0",
"gh-pages": "^3.1.0",
"html-webpack-plugin": "^3.2.0",
"npm": "^8.1.0",
@@ -18,7 +18,7 @@
"vue-template-compiler": "^2.6.12",
"webpack": "^5.25.1",
"webpack-cli": "^4.9.0",
"webpack-dev-server": "^4.3.1",
"webpack-dev-server": "^4.7.4",
"webpack-glsl-loader": "^1.0.1"
},
"dependencies": {

View File

@@ -35,7 +35,7 @@ num-traits = "0.2.14"
img_pixel = { package = "image", version = "0.23.14" }
egui = "*"
epi = "*"
fontdue = "*"
fontdue = "0.7.2"
enum_dispatch = "0.3.7"
al-core = { path = "./al-core" }

View File

@@ -9,7 +9,6 @@ futures = "0.3.12"
js-sys = "0.3.47"
wasm-bindgen-futures = "0.4.20"
cgmath = "*"
fontdue = "0.6.2"
image = "0.23.14"
lazy_static = "1.4.0"
serde = { version = "^1.0.59", features = ["derive"] }

View File

@@ -9,7 +9,7 @@ futures = "0.3.12"
js-sys = "0.3.47"
wasm-bindgen-futures = "0.4.20"
cgmath = "*"
fontdue = "0.6.2"
fontdue = "0.7.2"
image = "0.23.14"
lazy_static = "1.4.0"
serde = { version = "^1.0.59", features = ["derive"] }

View File

@@ -22,6 +22,8 @@ struct LabelMeta {
num_idx: u16,
}
use fontdue::Font;
pub struct TextRenderManager {
gl: WebGlContext,
shader: Shader,
@@ -41,15 +43,13 @@ pub struct TextRenderManager {
indices: Vec<u16>,
labels: Vec<LabelMeta>,
font: fontdue::Font,
font: Font,
}
use wasm_bindgen::JsValue;
use cgmath::{Vector2, Basis2, Rotation2, Rad};
use al_core::text::Font;
use al_core::VecData;
use wasm_bindgen::prelude::*;
use web_sys::WebGl2RenderingContext;
use fontdue::layout::*;
use crate::Color;
use crate::camera::CameraViewPort;
@@ -112,7 +112,7 @@ impl TextRenderManager {
VecData::<u16>(&indices),
);
let text_size = 12.0;
let Font { size, bitmap, letters, font } = al_core::text::rasterize_font(text_size);
let al_core::text::Font { size, bitmap, letters, font } = al_core::text::rasterize_font(text_size);
let font_texture = Texture2D::create_from_raw_pixels::<al_core::format::RGBA8U>(
&gl,

View File

@@ -35,12 +35,14 @@ export let WebGLCtx = (function() {
})();
function checkForWebGL2Support() {
/*const gl = document
const gl = document
.createElement('canvas')
.getContext('webgl2');
return gl;*/
return gl;
/*
// Run WebGL1 version only
return false;
*/
}

View File

@@ -23,7 +23,7 @@ module.exports = {
plugins: [
//new HtmlWebpackPlugin(),
// WebGL1 app
new WasmPackPlugin({
/*new WasmPackPlugin({
crateDirectory: path.resolve(__dirname, "src/core"),
// Check https://rustwasm.github.io/wasm-pack/book/commands/build.html for
// the available set of arguments.
@@ -64,9 +64,9 @@ module.exports = {
// Controls plugin output verbosity, either 'info' or 'error'.
// Defaults to 'info'.
// pluginLogLevel: 'info'
}),
}),*/
// WebGL2 app
/*new WasmPackPlugin({
new WasmPackPlugin({
crateDirectory: path.resolve(__dirname, "src/core"),
// Check https://rustwasm.github.io/wasm-pack/book/commands/build.html for
// the available set of arguments.
@@ -107,7 +107,7 @@ module.exports = {
// Controls plugin output verbosity, either 'info' or 'error'.
// Defaults to 'info'.
// pluginLogLevel: 'info'
}),*/
}),
// Have this example work in Edge which doesn't ship `TextEncoder` or
// `TextDecoder` at this time.
new webpack.ProvidePlugin({