Page 1 of 1

Make monospace font-size configurable

Posted: Tue Feb 19, 2013 11:20 am
by Thomas Lohrum
Alex,

please allow the size of the monospace-font to be independent from the notes-list font-size. No need for a GUI setting. A simple setting in the settings-file will be fine. The corresponding discussion can be found here: viewtopic.php?f=3&t=1463

Thank you!

Thomas

Re: Make monospace font-size configurable

Posted: Tue Feb 19, 2013 1:29 pm
by CintaNotes Developer
Thomas,
this enhancement is unfortunately not trivial to do, since now the editor only supports single font size.
If we add support for multiple sizes, we will need to update large parts of code responsible
for calculating line heights etc, both in editor and in the note preview renderer.

So I am willing to go forward on this only if I see much demand from the community.
Could you please add this request to the roadmap?
Thanks!

Re: Make monospace font-size configurable

Posted: Tue Feb 19, 2013 10:01 pm
by Thomas Lohrum
CintaNotes Developer wrote:this enhancement is unfortunately not trivial to do, since now the editor only supports single font size.

Thank you for your explanation. I understand. However, i am not asking for mixed font sizes. I use a monospace font as the default for my notes. Now the times has come to switch to a proportional font. This is because of the great support of bullet lists. We talked about this before. For a migration i will export all notes, modify them to mark them as monospace, change the notes-list font, and import back. So far, so good.

The problem is, that when i open an old note that uses a fixed font, the text looks just small. This is the nature of fixed font. They look smaller compared to a proportional font, even when they have the same size.

I realize CN works different from my expectations. What would be needed to solve the issue, is a way to mark a note to be a fixed-font-note. This would imply, that it is not possible to mix fonts. It would also allow to use a font and a size of its own.

Any ideas on this Alex?

Thank you.

Thomas

Re: Make monospace font-size configurable

Posted: Wed Feb 20, 2013 11:10 am
by CintaNotes Developer
I think you could try the following:
1) Export to XML
2) In XML do text replace:

Code: Select all

plainText="1"
=>

Code: Select all

plainText="0"

Code: Select all

<![CDATA[
=>

Code: Select all

<![CDATA[<pre>

Code: Select all

]]>
=>

Code: Select all

</pre>]]>


At least I think it's worth a try)

Re: Make monospace font-size configurable

Posted: Sat Feb 23, 2013 12:06 am
by Thomas Lohrum
CintaNotes Developer wrote:I think you could try the following:
1) Export to XML
2) In XML do text replace:

Hi Alex,

i tried this approach, as i already did last December. I can not get it to work, the way i like it. For example, when i export such a note to HTML, word-wrap is not supported. The note is not readable. I think what i need is a setting that affects the entire note, such as FixedFont="1". No need for <pre> tags. If set to true ("1") the monospace font will be used. If set to false ("0") the notes list font will be used.

What do you think? Am i missing something? Would it be difficult to implement? I want to post a request to the roadmap, but like to understand the matter, before doing so.

Thanks

Thomas

Re: Make monospace font-size configurable

Posted: Tue Feb 26, 2013 2:20 am
by CintaNotes Developer
Thomas Lohrum wrote:i tried this approach, as i already did last December. I can not get it to work, the way i like it. For example, when i export such a note to HTML, word-wrap is not supported. The note is not readable. I think what i need is a setting that affects the entire note, such as FixedFont="1". No need for <pre> tags. If set to true ("1") the monospace font will be used. If set to false ("0") the notes list font will be used.

What do you think? Am i missing something? Would it be difficult to implement? I want to post a request to the roadmap, but like to understand the matter, before doing so.

Ok, so the problem is word wrapping. I think it should be quite easy to do it with Python, it contains a special module called textwrap
just for this purpose:

Code: Select all

import textwrap

text = 'The quick brown fox jumps over the lazy dog.'
print('\n'.join(textwrap.wrap(text, width=20)))


It would be easiest to re-use parts of the xml2txtdir utility code from here: http://cintanotes.com/forum/viewtopic.php?f=3&t=1352.
If you need my help, just ask)

Re: Make monospace font-size configurable

Posted: Tue Feb 26, 2013 10:44 am
by Thomas Lohrum
CintaNotes Developer wrote:Ok, so the problem is word wrapping. I think it should be quite easy to do it with Python, it contains a special module called textwrap just for this purpose:

Thanks Alex, but i don't understand how that would help me.

To make things clearer and have a general approach i suggest to have an option on per note setting. Mark the complete note as either monospace or proportional font note. That way the only thing that must be done, is to decide which font to use when opening the note. No need to switch fonts oder mix fonts while the editor is open.

Thomas

Re: Make monospace font-size configurable

Posted: Thu Feb 28, 2013 8:20 am
by CintaNotes Developer
Thomas Lohrum wrote:
CintaNotes Developer wrote:Ok, so the problem is word wrapping. I think it should be quite easy to do it with Python, it contains a special module called textwrap just for this purpose:

Thanks Alex, but i don't understand how that would help me.

To make things clearer and have a general approach i suggest to have an option on per note setting. Mark the complete note as either monospace or proportional font note. That way the only thing that must be done, is to decide which font to use when opening the note. No need to switch fonts oder mix fonts while the editor is open.

Thomas


I think your solution is much more complicated than is really necessary.
The extra mode will create more user confusion, more modes means more bugs, and the db format will have to be changed.
This clearly is overkill for a one-time format migration task.

I suggest you to use the Python script that would just insert linebreaks into XML where you're now missing them. I can help you with it if you want, it's no problem.

Re: Make monospace font-size configurable

Posted: Thu Feb 28, 2013 5:30 pm
by Thomas Lohrum
Thanks for your help Alex. This afternoon i switched from Courier New 10 to Verdana 11. I take the risk. At first sight things look good. I also did some exports to verify the changes. In case of notes, that won't look well with the proportional font i will select the entire text and mark it as monospace. Due to the feature "save without modifying timestamp" i can update it without hassle.

I also voted for the following request, that describes my need in a more general approach: http://roadmap.cintanotes.com/topic/147 ... r-sources/

Thomas