Mercurial > dive4elements > river
view artifacts/src/main/java/org/dive4elements/river/exports/ChartExportFontMapper.java @ 9325:094ed9d1f2ad
Fixed: change of point style of interpolated data did not change in WQ chart of fixanalysis
Fixed: change of point style of interpolated data did not change in dWt chart of fixanalysis; also had duplicate legend entries
author | gernotbelger |
---|---|
date | Fri, 27 Jul 2018 14:33:41 +0200 |
parents | 36c80c7fd02f |
children |
line wrap: on
line source
/** Copyright (C) 2017 by Bundesanstalt für Gewässerkunde * Software engineering by * Björnsen Beratende Ingenieure GmbH * Dr. Schumacher Ingenieurbüro für Wasser und Umwelt * * This file is Free Software under the GNU AGPL (>=v3) * and comes with ABSOLUTELY NO WARRANTY! Check out the * documentation coming with Dive4Elements River for details. */ package org.dive4elements.river.exports; import java.awt.Font; import java.io.IOException; import com.lowagie.text.DocumentException; import com.lowagie.text.ExceptionConverter; import com.lowagie.text.pdf.BaseFont; import com.lowagie.text.pdf.FontMapper; /** * @author Domenico Nardi Tironi * */ public class ChartExportFontMapper implements FontMapper { @Override public Font pdfToAwt(final BaseFont font, final int size) { throw new UnsupportedOperationException(); } @Override public BaseFont awtToPdf(final Font font) { try { if (font.isItalic()) { if (font.isBold()) return BaseFont.createFont("fonts/Roboto/Roboto-BoldItalic.ttf", BaseFont.IDENTITY_H, false); else return BaseFont.createFont("fonts/Roboto/Roboto-Italic.ttf", BaseFont.IDENTITY_H, false); } else { if (font.isBold()) return BaseFont.createFont("fonts/Roboto/Roboto-Bold.ttf", BaseFont.IDENTITY_H, false); else return BaseFont.createFont("fonts/Roboto/Roboto-Regular.ttf", BaseFont.IDENTITY_H, false); } } catch (DocumentException | IOException e) { e.printStackTrace(); throw new ExceptionConverter(e); } } }