Skip to content

Commit

Permalink
Merge pull request #10 from telefonicasc/rg2011/font-support
Browse files Browse the repository at this point in the history
Added support for custom fonts
  • Loading branch information
IvanHdzC authored Sep 7, 2020
2 parents f7aa3af + ba31779 commit f3ca2c8
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
37 changes: 37 additions & 0 deletions hooks/font-support.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/bin/bash
# Copyright 2020 Telefónica Soluciones de Informática y Comunicaciones de España, S.A.U.
#
# This file is part of Pentaho DSP.
#
# Pentaho DSP is free software: you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# Pentaho DSP is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
# General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with Orion Context Broker. If not, see http://www.gnu.org/licenses/.
#
# For those usages not covered by this license please contact with
# sc_support at telefonica dot com

set -eoux pipefail

export CONFFILE="${PENTAHO_HOME}/pentaho-solutions/system/ImportHandlerMimeTypeDefinitions.xml"
export FONTDATA="application/vnd.ms-fontobject:eot application/x-font-ttf:ttf application/font-woff:woff application/font-woff2:woff2 application/font-sfnt:otf"

for FONTDESC in ${FONTDATA}; do
IFS=: read MIMETYPE EXTENSION <<< ${FONTDESC}
if ! grep "${MIMETYPE}" "${CONFFILE}"; then
echo "ACTIVANDO soporte de fuente ${EXTENSION} (MimeType ${MIMETYPE})"
# Agrego la linea delante de la definicion del MimeType pdf, por ejemplo.
sed -i "/<MimeTypeDefinition mimeType=\"text\/pdf\"/i <MimeTypeDefinition mimeType=\"${MIMETYPE}\" hidden=\"true\"><extension>${EXTENSION}</extension></MimeTypeDefinition>\n" "${CONFFILE}"
else
echo "COMPROBADO soporte de fuente ${EXTENSION} (MimeType ${MIMETYPE})"
fi
done

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

<groupId>org.telefonica.urbo2</groupId>
<artifactId>pentaho-dsp</artifactId>
<version>1.1.1</version>
<version>1.1.3</version>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down

0 comments on commit f3ca2c8

Please sign in to comment.