Including Liberation .ttf fonts in a grails war?

前端 未结 1 759
死守一世寂寞
死守一世寂寞 2021-01-16 07:02

How do I package the liberation fonts with my grails war? The fonts may not be available on the servers I\'m deploying to, and I need the fonts for my reporting system.

1条回答
  •  臣服心动
    2021-01-16 08:06

    If you're using them for jasper-reports explicitly, then you can just do this.

    grails-app/conf/jasperreports_extension.properties

    net.sf.jasperreports.extension.registry.factory.simple.font.families=net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory
    net.sf.jasperreports.extension.simple.font.families.liberationsans=jasper_fonts.xml
    

    grails-app/conf/jasper_fonts.xml

    
    
        
            lib/fonts/liberation-fonts-ttf-1.07.0/LiberationSans-Regular.ttf
            lib/fonts/liberation-fonts-ttf-1.07.0/LiberationSans-Bold.ttf
            lib/fonts/liberation-fonts-ttf-1.07.0/LiberationSans-Italic.ttf
            lib/fonts/liberation-fonts-ttf-1.07.0/LiberationSans-BoldItalic.ttf
            Identity-H
            true
            
                'Liberation Sans', Arial, Helvetica, sans-serif
                'Liberation Sans', Arial, Helvetica, sans-serif
            
        
    
    

    Modify as appropriate for your TTF font. Make sure you note the element, so your HTML reports don't break.

    0 讨论(0)
提交回复
热议问题