Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

font_family doesn't work in WEB_BROWSER mode #1794

Closed
m8factorial opened this issue Sep 2, 2023 · 2 comments
Closed

font_family doesn't work in WEB_BROWSER mode #1794

m8factorial opened this issue Sep 2, 2023 · 2 comments

Comments

@m8factorial
Copy link

Description

A custom font_family doesn't work when I launch my app in WEB_BROWSER mode

Code example to reproduce the issue:

import flet as ft

def main(page: ft.Page):
    page.fonts = {
        "RobotoSlab": "https://github.com/google/fonts/raw/main/apache/robotoslab/RobotoSlab%5Bwght%5D.ttf"
    }

    t = ft.Text(
        "This is rendered with Roboto Slab, but not in WEB_BROSER mode",
        size=30,
        font_family="RobotoSlab",
        weight=ft.FontWeight.W_100,
    )

    page.add(t)
    page.update()

ft.app(target=main, view=ft.WEB_BROWSER)

Flet version (pip show flet):

Name: flet
Version: 0.10.1
Summary: Flet for Python - easily build interactive multi-platform apps in Python
Home-page: None
Author: Appveyor Systems Inc.
Author-email: hello@flet.dev
License: Apache-2.0
Location: /home/mdo/python/venv/lib/python3.9/site-packages
Requires: copier, flet-runtime, qrcode, packaging, websocket-client, websockets, watchdog
Required-by: 

Operating system:
Debian GNU/Linux 11 (bullseye)

@FeodorFitsner
Copy link
Contributor

Are there any errors on Network/Console tab of your browser. I bet there is CORS error blocking direct requests to GitHub content from 3rd-party sites.

@m8factorial
Copy link
Author

Sure! Thank you! I did not noticed it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants