Customizable fonts
SankethBK opened this issue · 15 comments
Currently, static fonts are used throughout the app. An option to customize font family and font size in the settings page should be provided. When user changes font family / size, it can be stored in lib/features/auth/data/models/user_config_model.dart
class. UserConfigModel
will be persisted in shared preferences
@SankethBK I would like to do that customization of the font family or size, and store it in shared preferences.
Please assign me this issue in hacktoberfest.
Sure, instead of storing it directly in shared preferences, i'd recommend using UserConfigModel
where we store all the user settings. Add two new fields like preferredFontSize
and preferredFontFamily
and use UserConfigCubit
to interact with it
Adding more details
- Create an accordion "Font Customization" which has two dropdowns for Font size and Font style
font_customization.webm
-
Add two new fields like
preferredFontSize
andpreferredFontFamily
inUserConfigModel
to store the values of these dropdowns and useUserConfigCubit
to interact with it -
Apply
preferredFontSize
andpreferredFontFamily
only for text at these places
a.title
andplainText
inNotePreviewCard
.
b.title
inNoteTitleInputField
c.title
inNotesReadOnlyPage
.
d.DefaultTextStyle
inGlassPaneForEditor
andReadOnlyEditor
.
@SankethBK really sorry for the delay, i got ill; I am working and will not disappoint you
hi @SankethBK what are the font size of small, medium and large?
Hi @nandhagobal, we need to apply fontSize and fontFamily at only these places
Apply preferredFontSize and preferredFontFamily only for text at these places
a. title and plainText in NotePreviewCard.
b. title in NoteTitleInputField
c. title in NotesReadOnlyPage.
d. DefaultTextStyle in GlassPaneForEditor and ReadOnlyEditor.
The problem is we are using different font sizes at different places. Give me some time, i'll simplify the issue
sure @SankethBK .i already understood partially.let me know once it is done, i will take this issue.
hi @SankethBK, you said you will simplify this issue. i have implemented this font customization but that font size is not changing for notes(defaultTextStyle widget) section in both read mode and write mode.
Hi @nandhagobal , sorry couldn't prioritize this. Can you raise the PR with your current changes, I'll check and let you know
yeah sure.
I'm unshure as to how you could to create a monospaced text in a single note, and then sync it to another device🤔
Hi @ChiefMikeK , font is used as one of the attributes of rich text, we store rich text in delta format. For example if your note has two different fonts like
Hello (in monospace) World (in Roboto)
It would be internally represented as something like this
[{"text": "Hello", "attributes": {"font-family": "Monospace"}},
{"text": "World", "attributes": {"font-family": "Roboto"}}]
Font-family is just one of the many properties along with bold, italics, underline, etc.
This feature is almost ready, I'll add it in next release
This feature is added in the lastest release