Skip to content

Commit

Permalink
Merge pull request #4068 from camptocamp/font
Browse files Browse the repository at this point in the history
Fix font loading
  • Loading branch information
sbrunner committed Jul 31, 2018
2 parents 2cba0ae + 27a285f commit d345998
Show file tree
Hide file tree
Showing 33 changed files with 153 additions and 100 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
/contribs/gmf/apps/.tx/ngeo.gmf-*
/examples/simple.min.js
/contribs/gmf/build/
/contribs/gmf/src/fonts/gmf-icons.eot
/contribs/gmf/src/fonts/gmf-icons.ttf
/contribs/gmf/src/fonts/gmf-icons.woff
/contribs/gmf/src/fonts/FontAwesome*
/contribs/gmf/src/fonts/fontawesome*
/contribs/gmf/examples/https.js
Expand Down
3 changes: 0 additions & 3 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
/karma-conf.js
/lingua.cfg
/Makefile
/ngeo_deploy_key
/TODO.md
/npm.mk
/secrets.tar
/secrets.tar.enc
/test/
Expand Down
16 changes: 0 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -400,19 +400,6 @@ contribs/gmf/build/gmf-%.json: \
mkdir -p $(dir $@)
node buildtools/compile-catalog $(filter-out .build/node_modules.timestamp, $^) > $@

.PHONY: generate-gmf-fonts
generate-gmf-fonts: contribs/gmf/src/fonts/gmf-icons.ttf contribs/gmf/src/fonts/gmf-icons.eot contribs/gmf/src/fonts/gmf-icons.woff

contribs/gmf/src/fonts/gmf-icons.ttf: contribs/gmf/src/fonts/gmf-icons.svg .build/node_modules.timestamp
node_modules/svg2ttf/svg2ttf.js $< $@

contribs/gmf/src/fonts/gmf-icons.eot: contribs/gmf/src/fonts/gmf-icons.ttf .build/node_modules.timestamp
node_modules/ttf2eot/ttf2eot.js $< $@

contribs/gmf/src/fonts/gmf-icons.woff: contribs/gmf/src/fonts/gmf-icons.ttf .build/node_modules.timestamp
node_modules/ttf2woff/ttf2woff.js $< $@

# clean

.PHONY: clean
clean:
Expand All @@ -431,9 +418,6 @@ clean:
rm -f .build/locale/demo.pot
rm -rf contribs/gmf/build
rm -f $(ANGULAR_LOCALES_FILES)
rm -f contribs/gmf/src/fonts/gmf-icons.eot
rm -f contribs/gmf/src/fonts/gmf-icons.ttf
rm -f contribs/gmf/src/fonts/gmf-icons.woff

.PHONY: cleanall
cleanall: clean
Expand Down
4 changes: 2 additions & 2 deletions buildtools/webpack.plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ function fillDependency(pluginOptions, usedContext, compilation, assetName, asse
console.log(err);
reject(err);
} else {
fs.readFile(resolvedFile, 'utf8', (err, data) => {
fs.readFile(resolvedFile, (err, data) => {
if (err) {
console.log(err);
reject(err);
Expand All @@ -236,7 +236,7 @@ function fillDependency(pluginOptions, usedContext, compilation, assetName, asse
}
});
} else {
fs.readFile(assetName, 'utf8', (err, data) => {
fs.readFile(assetName, (err, data) => {
if (err) {
console.log(err);
reject(err);
Expand Down
2 changes: 1 addition & 1 deletion contribs/gmf/apps/desktop/index.html.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,6 @@
<% for (var chunk in htmlWebpackPlugin.files.chunks) { %>
<script src="<%= htmlWebpackPlugin.files.chunks[chunk].entry %>"></script>
<% } %>
<script src="https://geomapfish-demo.camptocamp.com/2.3/wsgi/dynamic.js?interface=desktop"></script>
<script src="https://geomapfish-demo.camptocamp.com/docker/dynamic.js?interface=desktop"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion contribs/gmf/apps/desktop_alt/index.html.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,6 @@
<% for (var chunk in htmlWebpackPlugin.files.chunks) { %>
<script src="<%= htmlWebpackPlugin.files.chunks[chunk].entry %>"></script>
<% } %>
<script src="https://geomapfish-demo.camptocamp.com/2.3/wsgi/dynamic.js?interface=desktop_alt"></script>
<script src="https://geomapfish-demo.camptocamp.com/docker/wsgi/dynamic.js?interface=desktop"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion contribs/gmf/apps/mobile/index.html.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</div>
<button class="gmf-mobile-nav-trigger gmf-mobile-nav-left-trigger"
ng-click="mainCtrl.toggleLeftNavVisibility()">
<span class="gmf-icon gmf-icon-layers"></span>
<img src="<%=require("gmf/icons/layers.svg")%>" />
</button>
<gmf-search gmf-search-map="::mainCtrl.map"
gmf-search-datasources="::mainCtrl.searchDatasources"
Expand Down
2 changes: 1 addition & 1 deletion contribs/gmf/apps/mobile_alt/index.html.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
</div>
<button class="gmf-mobile-nav-trigger gmf-mobile-nav-left-trigger"
ng-click="mainCtrl.toggleLeftNavVisibility()">
<span class="gmf-icon gmf-icon-layers"></span>
<img src="<%=require("gmf/icons/layers.svg")%>" />
</button>
<gmf-search gmf-search-map="mainCtrl.map"
gmf-search-datasources="mainCtrl.searchDatasources"
Expand Down
15 changes: 0 additions & 15 deletions contribs/gmf/examples/importdatasource.css
Original file line number Diff line number Diff line change
@@ -1,18 +1,3 @@
/**
* Fonts definition
*/
@font-face {
font-family: "gmf-icons";
src: url("~gmf/fonts/gmf-icons.eot");
src: url("~gmf/fonts/gmf-icons.eot?#iefix") format("embedded-opentype"),
url("~gmf/fonts/gmf-icons.woff") format("woff"),
url("~gmf/fonts/gmf-icons.ttf") format("truetype"),
url("~gmf/fonts/gmf-icons.svg#gmf-icons") format("svg");
font-weight: normal;
font-style: normal;
}


/* CSS stolen from https://github.com/bassjobsen/typeahead.js-bootstrap-css/ */
span.twitter-typeahead .tt-menu {
position: absolute;
Expand Down
2 changes: 2 additions & 0 deletions contribs/gmf/src/controllers/desktop.scss
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ $border-color: darken($brand-primary, $standard-variation) !default;

@import '~gmf/layertree/desktop.scss';

@import "~font-awesome/scss/font-awesome.scss";

html, body {
position: relative;
height: 100%;
Expand Down
3 changes: 2 additions & 1 deletion contribs/gmf/src/controllers/mobile.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ $border-color: black !default;
@import "~bootstrap/scss/_variables.scss";
@import "~font-awesome/scss/_variables.scss";

@import '~gmf/sass/font.scss';
@import '~gmf/sass/base.scss';
@import '~gmf/sass/map.scss';
@import '~gmf/sass/icons.scss';
Expand All @@ -23,6 +22,8 @@ $border-color: black !default;

@import '~gmf/layertree/mobile.scss';

@import "~font-awesome/scss/font-awesome.scss";

/**
* Mobile specific css only !
* Please, use shared less files to describe desktop-mobile shared css
Expand Down
12 changes: 6 additions & 6 deletions contribs/gmf/src/drawing/drawFeatureComponent.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
class="btn btn-default ngeo-drawfeature-point"
ng-class="{active: dfCtrl.drawPoint.active}"
ng-model="dfCtrl.drawPoint.active">
<span class="gmf-icon gmf-icon-point"></span>
<img src="<%=require("gmf/icons/point.svg")%>" />
</a>
<a
data-toggle="tooltip"
Expand All @@ -24,7 +24,7 @@
class="btn btn-default ngeo-drawfeature-linestring"
ng-class="{active: dfCtrl.measureLength.active}"
ng-model="dfCtrl.measureLength.active">
<span class="gmf-icon gmf-icon-line"></span>
<img src="<%=require("gmf/icons/line.svg")%>" />
</a>
<a
data-toggle="tooltip"
Expand All @@ -35,7 +35,7 @@
class="btn btn-default ngeo-drawfeature-polygon"
ng-class="{active: dfCtrl.measureArea.active}"
ng-model="dfCtrl.measureArea.active">
<span class="gmf-icon gmf-icon-polygon"></span>
<img src="<%=require("gmf/icons/polygon.svg")%>" />
</a>
<a
data-toggle="tooltip"
Expand All @@ -46,7 +46,7 @@
class="btn btn-default ngeo-drawfeature-circle"
ng-class="{active: dfCtrl.measureAzimut.active}"
ng-model="dfCtrl.measureAzimut.active">
<span class="gmf-icon gmf-icon-circle"></span>
<img src="<%=require("gmf/icons/circle.svg")%>" />
</a>
<a
data-toggle="tooltip"
Expand All @@ -57,7 +57,7 @@
class="btn btn-default ngeo-drawfeature-rectangle"
ng-class="{active: dfCtrl.drawRectangle.active}"
ng-model="dfCtrl.drawRectangle.active">
<span class="gmf-icon gmf-icon-rectangle"></span>
<img src="<%=require("gmf/icons/rectangle.svg")%>" />
</a>
<a
data-toggle="tooltip"
Expand All @@ -68,7 +68,7 @@
class="btn btn-default ngeo-drawfeature-text"
ng-class="{active: dfCtrl.drawText.active}"
ng-model="dfCtrl.drawText.active">
<span class="gmf-icon gmf-icon-text"></span>
<img src="<%=require("gmf/icons/text.svg")%>" />
</a>
</ngeo-drawfeature>

Expand Down
12 changes: 6 additions & 6 deletions contribs/gmf/src/editing/editFeatureComponent.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,27 @@
ng-model="efCtrl.createActive">
<span ng-switch="::efCtrl.geomType">
<span ng-switch-when="Point">
<span class="gmf-icon gmf-icon-point"></span>
<img src="<%=require("gmf/icons/point.svg")%>" />
{{'Draw new point' | translate}}
</span>
<span ng-switch-when="MultiPoint">
<span class="gmf-icon gmf-icon-point"></span>
<img src="<%=require("gmf/icons/point.svg")%>" />
{{'Draw new point' | translate}}
</span>
<span ng-switch-when="LineString">
<span class="gmf-icon gmf-icon-line"></span>
<img src="<%=require("gmf/icons/line.svg")%>" />
{{'Draw new linestring' | translate}}
</span>
<span ng-switch-when="MultiLineString">
<span class="gmf-icon gmf-icon-line"></span>
<img src="<%=require("gmf/icons/line.svg")%>" />
{{'Draw new linestring' | translate}}
</span>
<span ng-switch-when="Polygon">
<span class="gmf-icon gmf-icon-polygon"></span>
<img src="<%=require("gmf/icons/polygon.svg")%>" />
{{'Draw new polygon' | translate}}
</span>
<span ng-switch-when="MultiPolygon">
<span class="gmf-icon gmf-icon-polygon"></span>
<img src="<%=require("gmf/icons/polygon.svg")%>" />
{{'Draw new polygon' | translate}}
</span>
</span>
Expand Down
12 changes: 0 additions & 12 deletions contribs/gmf/src/fonts/README.md

This file was deleted.

9 changes: 9 additions & 0 deletions contribs/gmf/src/icons/check.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions contribs/gmf/src/icons/circle.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions contribs/gmf/src/icons/dot.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
9 changes: 9 additions & 0 deletions contribs/gmf/src/icons/line.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions contribs/gmf/src/icons/list.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions contribs/gmf/src/icons/map-o.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions contribs/gmf/src/icons/map.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions contribs/gmf/src/icons/point.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions contribs/gmf/src/icons/polygon.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d345998

Please sign in to comment.