fonts

ReportLab Django Not Rendering Chinese Characters

家住魔仙堡 提交于 2021-02-08 10:25:03
问题 I'm having difficulty making ReportLab render Chinese Characters. From everything I've looked up people are saying that it is probably a font problem but I've used a lot of different fonts and it doesn't even seem to be using them at all. The Chinese characters always just come out as black squares. Below is some sample code of what I have. # -*- coding: utf8 -*- from reportlab.lib.pagesizes import letter from reportlab.pdfbase.ttfonts import TTFont from io import BytesIO pdfmetrics

fonttools convert ttf to woff2

不想你离开。 提交于 2021-02-08 07:42:43
问题 Currenly, I'm using fonttools(https://github.com/fonttools/fonttools) to convert font file ttf to woff2 by ttx command with 2 steps convert ttf to ttx then convert ttx to woff2 But it's too slow and ttx file to big, is there any way to convert ttf to woff2 directly by using fonttools to improve performance? 回答1: With fonttools installed in your Python (virtualenv, pipenv, etc): $ python >>> from fontTools.ttLib import TTFont >>> f = TTFont('path/to/your/file.otf') >>> f.flavor='woff2' >>> f

fonttools convert ttf to woff2

依然范特西╮ 提交于 2021-02-08 07:41:17
问题 Currenly, I'm using fonttools(https://github.com/fonttools/fonttools) to convert font file ttf to woff2 by ttx command with 2 steps convert ttf to ttx then convert ttx to woff2 But it's too slow and ttx file to big, is there any way to convert ttf to woff2 directly by using fonttools to improve performance? 回答1: With fonttools installed in your Python (virtualenv, pipenv, etc): $ python >>> from fontTools.ttLib import TTFont >>> f = TTFont('path/to/your/file.otf') >>> f.flavor='woff2' >>> f

Adding Google Fonts to Flask

限于喜欢 提交于 2021-02-07 20:36:56
问题 So with flask I know that I can add CSS with <link ... href="{{ url_for('static', filename='stylesheets/style.css') }}" /> but if I am adding a google font which usually in HTML looks like <link href='http://fonts.googleapis.com/css?family=PT+Sans:400,700' rel='stylesheet' type='text/css'> what do I need to edit/add for it to work with Flask? 回答1: You can't use static here like you would normally for a link to a resource on the webserver. Your link is still essentially static but not related

Bootstrap CSS without Google Fonts 2 (Bootswatch)

别来无恙 提交于 2021-02-07 19:20:40
问题 I'm developing a webpage and I use Bootswatch for styling. Sometimes I have to work offline, and host locally. Unfortunately Bootswatch can't be used offline since it uses a version of Bootstrap css with an extra font at the begining: @import url("https://fonts.googleapis.com/css?family=Lato:300,400,700"); This means build fails every time, and I can't deploy. I've seen the question: Bootstrap CSS without Google Fonts But it doesn't have a satisfactory answer. They suggest just deleting that

Why does GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts() give different results when ssh'ed in?

≯℡__Kan透↙ 提交于 2021-02-07 14:16:19
问题 Why does the following program return different results depending on how I'm logged in? I'm compiling and running this program using Java 7 update 60 on a freshly installed Mac OS X Mavericks system. If I compile and run this in a shell when logged into the system normally I get less fonts than when I ssh into the system and run it. The program is as follows: import java.awt.Font; import java.awt.GraphicsEnvironment; public class FontList { public static void main(String[] args) { final Font[

Get list of fonts (Win32)

耗尽温柔 提交于 2021-02-07 13:45:40
问题 I want to make a combo box with all of the computer's installed fonts enumerated in it. I'm not sure how this is done. Do I need to access the registry to get this? Thanks 回答1: You should use the Win32 API function EnumFontFamiliesEx. You call that function, passing a callback function matching the type of EnumFontFamExProc. The callback function is called once for every font found by EnumFontFamiliesEx. I'd recommend using the unicode version (EnumFontFamiliesExW), as I've seen the ascii

Get list of fonts (Win32)

旧时模样 提交于 2021-02-07 13:43:31
问题 I want to make a combo box with all of the computer's installed fonts enumerated in it. I'm not sure how this is done. Do I need to access the registry to get this? Thanks 回答1: You should use the Win32 API function EnumFontFamiliesEx. You call that function, passing a callback function matching the type of EnumFontFamExProc. The callback function is called once for every font found by EnumFontFamiliesEx. I'd recommend using the unicode version (EnumFontFamiliesExW), as I've seen the ascii

Are SVG fonts still working in Google Chrome?

冷暖自知 提交于 2021-02-07 12:29:18
问题 I have been redesigning a website for a while on and off, but for the last 6 months I've been out of the loop so to speak and may have missed something important regarding svg fonts no longer working with chrome? Here is a snippet of one of my stylesheets: @media screen and (-webkit-min-device-pixel-ratio:0) { @font-face { font-family: 'NewFont'; src: url("newfont-webfont.svg#NewFont") format("svg"); }} I've replaced the SVG with my WOFF version and the fonts look just about OK, however the

Wrong font displayed at runtime

☆樱花仙子☆ 提交于 2021-02-07 12:05:17
问题 I am using the Calibri font in some labels (winforms) and when I run my program, this label are displayed with a different font. I had seen this problem when testing on computers without Office (hence no Calibri installed) but now I see it everywhere, even on my computer where Calibri is well installed (and I see the labels with Calibri in the designer ; then when I run in debug mode, I see another font). The labels used to be displayed well, I've seen this problem only today (but could have