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

Blocks - Code blocks, Inline Code, RobotoMono font #17

Closed
adrian-moisa opened this issue May 20, 2022 · 3 comments
Closed

Blocks - Code blocks, Inline Code, RobotoMono font #17

adrian-moisa opened this issue May 20, 2022 · 3 comments
Assignees

Comments

@adrian-moisa
Copy link
Collaborator

adrian-moisa commented May 20, 2022

Current source code uses a regular font as it was done in Flutter Quill. Which is not the way code editors handle this situation.

image

Join on discord to get advice and help or follow us on YouTube Visual Coding to learn more about the architecture of Visual Editor and other Flutter apps.

@kairan77
Copy link

kairan77 commented Jul 16, 2022

You are supposed to feed your required style for each different tags when creating the editor, there you can specify which font family to use, the source code of quill in general is style agnostic, meaning all styles of all the different types of fragment are supposed to be SET BY the USER.

customStyles: DefaultStyles(
...
code: DefaultTextBlockStyle(
      const TextStyle(
        fontFamily: 'RobotoCondensed', // fill in your favorite mono font
        color: Colors.black87,
        fontSize: 15,
        height: 1.4,
      ),
      const Tuple2(0, 10),
      const Tuple2(0, 5),
      const BoxDecoration(
        color: Color(0xFFFCFCFC),
        borderRadius: BorderRadius.all(Radius.circular(5)),
      ),
    ),
)

@adrian-moisa
Copy link
Collaborator Author

Yes indeed, you can override styles, but that does not mean you can't provide a decent default value. Right? Code is never displayed in fonts that are not mono space for practical reasons. A sensible default does not harm. Quill Also decides a default font size. Obviously, it has to do so. Then if the font size has a default, why not a default for the code snippets? Any decent .md implementation will do the same for code snippets. Why not Quill?

@adrian-moisa adrian-moisa changed the title Monospace Font for code Blocks - Code blocks, Monospace font Nov 5, 2022
@adrian-moisa adrian-moisa added MVP and removed Medium labels Nov 5, 2022
@DariusMuscalu DariusMuscalu self-assigned this Nov 21, 2022
@DariusMuscalu DariusMuscalu changed the title Blocks - Code blocks, Monospace font Blocks - Code blocks, Inline Code, RobotoMono font Nov 21, 2022
@DariusMuscalu
Copy link
Collaborator

DariusMuscalu commented Nov 28, 2022

Also included in this commit:

  • Added a distinct icon for code block button in the toolbar, because it was using the same icon as inline code button.

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

When branches are created from issues, their pull requests are automatically linked.

3 participants