Skip to content

css attribute font-family isn't used #87

Description

@RealTachyon

Using css, the font-family attribute doesn't seem to be actually used.

This is the pdf that is generated from the following script:
font test 1.pdf

You can see that the font-size and color attributes are made use of, but the text isn't rendered in Comic Sans.
I have already tried many different fonts, each of which I've made sure that they are installed on my machine. But none are able to be used.
However, the sans-serif value is actually used.

from markdown_pdf import MarkdownPdf, Section

font_css = """
* {
	font-family: 'Comic Sans MS', sans-serif;
	font-size: 12px;
	color: #b42929;
}
"""

pdf = MarkdownPdf()

pdf.add_section(
	Section(
		"Text that I expect to be in my specified font",
	),
	user_css=font_css,
)

pdf.save(
	"font test 1.pdf"
)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions