fonts

PIL Issue, OSError: cannot open resource

爱⌒轻易说出口 提交于 2020-08-22 04:22:10
问题 I'm attempting to write a program that places text onto an image, I'm trying to get my head round PIL and have run into the error: OSError: cannot open resource. This is my first python program so apologies if the error is obvious. from PIL import Image from PIL import ImageDraw from PIL import ImageFont im = Image.open("example.jpg") font_type = ImageFont.truetype("Arial.ttf", 18) draw = ImageDraw.Draw(im) draw.text(xy=(50, 50), text= "Text One", fill =(255,69,0), font = font_type) im.show()

Cannot embed ggplot2 (/R) fonts in PDF with ggsave()

醉酒当歌 提交于 2020-08-10 23:42:09
问题 I have added a font to my ggplot2-plot, and it works perfectly when viewed in RStudio's plot viewer. However, when I try to save the plot as a PDF, NO text at all is printed (see code and pictures below): df <- data.frame(x = c(1:10), y = c(1:10)) # Dummy data plot <- ggplot(df, aes(x, y)) + # Dummy plot geom_point() + labs(title = "Correct font in R, NO fonts at all in pdf :-(") + theme(text = element_text(family = "latex")) Then I try to ggsave() the plot with the following code: ggsave("df

OpenHTMLToPDF: Embed a custom font into PDF created out of HTML

拜拜、爱过 提交于 2020-08-05 07:19:33
问题 I create a PDF from HTML with Jsoup and OpenHTMLToPDF. I have to use a different font in my PDF to have non-latin glyphcs covered (see here). How can I embed my font correctly? Simplified program reproducing the issue: src/main/resources/test.html <!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <title>Font Test</title> <style> @font-face { font-family: 'source-sans'; font-style: normal; font-weight: 400; src: url(fonts/SourceSansPro-Regular.ttf); } </style> </head> <body> <p style=

Roboto font in CSS

☆樱花仙子☆ 提交于 2020-08-04 01:17:39
问题 I would like to use "Roboto" font in prestashop. I've received design in .psd files and graphic designer used fonts "Roboto Medium" and "Roboto Regular". Do i understand correctly, that when i want to use Roboto Normal I can apply: font- family: "Roboto" font-weight: 400 and when i want to use Roboto Medium I should apply: font- family: "Roboto" font-weight: 500 In other words, are weights 400 and 500 respectively equal to Roboto Normal and Roboto Medium? 回答1: Make sure you are closing your

Roboto font in CSS

我是研究僧i 提交于 2020-08-04 01:17:05
问题 I would like to use "Roboto" font in prestashop. I've received design in .psd files and graphic designer used fonts "Roboto Medium" and "Roboto Regular". Do i understand correctly, that when i want to use Roboto Normal I can apply: font- family: "Roboto" font-weight: 400 and when i want to use Roboto Medium I should apply: font- family: "Roboto" font-weight: 500 In other words, are weights 400 and 500 respectively equal to Roboto Normal and Roboto Medium? 回答1: Make sure you are closing your