diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 00a0abb..bbd8110 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -35,7 +35,7 @@ jobs: with: version: ${{env.EM_VERSION}} actions-cache-folder: ${{env.EM_CACHE_FOLDER}} - - run: ./build.sh boost/boost/include + - run: ./build_wasm.sh boost/boost/include - run: BOOST_INCLUDEDIR=boost/boost/include cmake . && make - run: cd app && npm install && npx tsc && npx vite build --base=/font-maker/ - name: build_app diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0c027a0..7533574 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,7 +7,7 @@ The WASM outputs `sdfglyph.js` and `sdfglyph.wasm` are not committed to git. To * [sdfglyph.js](https://maplibre.org/font-maker/sdfglyph.js) * [sdfglyph.wasm](https://maplibre.org/font-maker/sdfglyph.wasm) -## Building +## Building WASM If you want to compile the WebAssembly components from scratch, you'll need the following: @@ -16,5 +16,11 @@ If you want to compile the WebAssembly components from scratch, you'll need the Clone this repository and all submodules with `git clone --recursive` -Use `./build.sh PATH_TO_INCLUDE_DIR` to build the WASM output, where `PATH_TO_INCLUDE_DIR` is the directory of your local Boost install. +Use `./build_wasm.sh PATH_TO_INCLUDE_DIR` to build the WASM output, where `PATH_TO_INCLUDE_DIR` is the directory of your local Boost install. example: `./build_wasm.sh /opt/local/include` +## Building command line + +``` +cmake . +make +``` \ No newline at end of file diff --git a/app/src/App.tsx b/app/src/App.tsx index 0311034..6e663d8 100644 --- a/app/src/App.tsx +++ b/app/src/App.tsx @@ -3,10 +3,7 @@ import "tachyons/css/tachyons.min.css"; import Pbf from "pbf"; import JSZip from "jszip"; import { saveAs } from "file-saver"; -import { - Map, - NavigationControl -} from "react-map-gl"; +import { Map, NavigationControl } from "react-map-gl"; import maplibregl from "maplibre-gl"; import "maplibre-gl/dist/maplibre-gl.css"; import { styleFunc } from "./style"; @@ -139,6 +136,10 @@ function App() { setFileUploads([...fileUploads, ...event.target.files!]); } + function clearFileInput() { + setFileUploads([]); + } + async function runFilesConvert() { if (fileUploads.length === 0) return; let bufs: ArrayBuffer[] = []; @@ -209,6 +210,12 @@ function App() { ); })} + {fileUploads.length > 0 ? ( + + ) : null} +