Delphi Editor font and TDBRichEdit font gives different results with same font. (Courier New 10)

Hello.

When I use Delphi Editor the letter l (L) has a little bottom line and
a little left side line at the top. This makes it clear that the letter
is not a capital I or a pipe symbol.
From options I can see that the editor font is Courier New size 10.

When I copy text from the editor and into my TDBRichEdit that also has
Courier New size 10, the letter l is just a vertical line with no small
horizontal lines at bottom and top.
So what is the difference between theese two, when the font is exactly
the same?

When experimenting a bit with the font in the TDBRichEdit, I find that
the font changes in design time, but don't change in runtime.
This goes for both entered new text and old text from database.

Have also tried to change to another component (TRzDBRichEdit), with
same result. Are there a middle layer somewhere that dictates the font
and overrides the component font?

Environment:
Win7
Delphi 2009E
Character Set: UTF8
Raize components 6.1.2.0
UniDac components, like:
TInterbaseUniProvider->TUniConnection->TUniQuery->TDataSource->DBGrid.
Firebird 2.5.0.26074
Database Workbench 4.4.2

Thanks in advance.

:)
Kai Inge
0
Kai
3/6/2014 9:24:40 PM
embarcadero.delphi.vcl.using 2297 articles. 2 followers. Follow

7 Replies
1283 Views

Similar Articles

[PageSpeed] 6

Kai Inge Buseth wrote:

> Hello.
> 
> When I use Delphi Editor the letter l (L) has a little bottom line and
> a little left side line at the top. This makes it clear that the
> letter is not a capital I or a pipe symbol.
> From options I can see that the editor font is Courier New size 10.
> 
> When I copy text from the editor and into my TDBRichEdit that also has
> Courier New size 10, the letter l is just a vertical line with no
> small horizontal lines at bottom and top.
> So what is the difference between theese two, when the font is exactly
> the same?
> 
> When experimenting a bit with the font in the TDBRichEdit, I find that
> the font changes in design time, but don't change in runtime.
> This goes for both entered new text and old text from database.
> 
> Have also tried to change to another component (TRzDBRichEdit), with
> same result. Are there a middle layer somewhere that dictates the font
> and overrides the component font?
> 
> Environment:
> Win7
> Delphi 2009E
> Character Set: UTF8
> Raize components 6.1.2.0
> UniDac components, like:
> TInterbaseUniProvider->TUniConnection->TUniQuery->TDataSource->DBGrid.
> Firebird 2.5.0.26074
> Database Workbench 4.4.2
> 
> Thanks in advance.
> 
> :)
> Kai Inge

After experimenting some more, it seems that Firebird itself dictates
the font from what was the font when the record was posted.
Only new records get the changed font and allow text entered in the
changed font.

Is it possible to tell Firebird to use the new font for the stored
data, or do I have to make a program that do this by code?
(Like copy the text to a TMemo with the new font and then delete the
original record and add a new record and then copy the text from TMemo
into it.
I believe it will work, but seems like tedious work if a better
solution is available.)

:)
Kai Inge
0
Kai
3/6/2014 10:08:22 PM
Kai Inge Buseth wrote:

> Kai Inge Buseth wrote:
> 
> > Hello.
> > 
> > When I use Delphi Editor the letter l (L) has a little bottom line
> > and a little left side line at the top. This makes it clear that the
> > letter is not a capital I or a pipe symbol.
> > From options I can see that the editor font is Courier New size 10.
> > 
> > When I copy text from the editor and into my TDBRichEdit that also
> > has Courier New size 10, the letter l is just a vertical line with
> > no small horizontal lines at bottom and top.
> > So what is the difference between theese two, when the font is
> > exactly the same?
> > 
> > When experimenting a bit with the font in the TDBRichEdit, I find
> > that the font changes in design time, but don't change in runtime.
> > This goes for both entered new text and old text from database.
> > 
> > Have also tried to change to another component (TRzDBRichEdit), with
> > same result. Are there a middle layer somewhere that dictates the
> > font and overrides the component font?
> > 
> > Environment:
> > Win7
> > Delphi 2009E
> > Character Set: UTF8
> > Raize components 6.1.2.0
> > UniDac components, like:
> > TInterbaseUniProvider->TUniConnection->TUniQuery->TDataSource->DBGri
> > d.  Firebird 2.5.0.26074
> > Database Workbench 4.4.2
> > 
> > Thanks in advance.
> > 
> > :)
> > Kai Inge
> 
> After experimenting some more, it seems that Firebird itself dictates
> the font from what was the font when the record was posted.
> Only new records get the changed font and allow text entered in the
> changed font.
> 
> Is it possible to tell Firebird to use the new font for the stored
> data, or do I have to make a program that do this by code?
> (Like copy the text to a TMemo with the new font and then delete the
> original record and add a new record and then copy the text from TMemo
> into it.
> I believe it will work, but seems like tedious work if a better
> solution is available.)
> 
> :)
> Kai Inge

Found a quick and dirty way to get the font I want, disregard what font
is stored in the BLOBs.
I made the two original DBmemos invisible and used a couple of ordinary
memo's additionally.
When I set theese two, non data aware memos, to Courier New 10 and in
qryMyData.AfterScroll update them from the invisible DBmemos,
the transferred text obey the font settings in the non data aware memos.
Not elegant, but works great. :-)

:)
Kai Inge
0
Kai
3/7/2014 10:46:25 AM
Kai Inge Buseth wrote:

> Kai Inge Buseth wrote:
> 
> > Hello.
> > 
> > When I use Delphi Editor the letter l (L) has a little bottom line
> > and a little left side line at the top. This makes it clear that the
> > letter is not a capital I or a pipe symbol.
> > From options I can see that the editor font is Courier New size 10.
> > 
> > When I copy text from the editor and into my TDBRichEdit that also
> > has Courier New size 10, the letter l is just a vertical line with
> > no small horizontal lines at bottom and top.
> > So what is the difference between theese two, when the font is
> > exactly the same?

The font the text in your richedit uses seems not to be the default
font. A richedit can contain text in any number of mixed fonts, you
know, and what you have set in the control's Font property is actually
only used when you start with a completely empty richedit.
> > 
> > When experimenting a bit with the font in the TDBRichEdit, I find
> > that the font changes in design time, but don't change in runtime.
> > This goes for both entered new text and old text from database.
> > 
> > Have also tried to change to another component (TRzDBRichEdit), with
> > same result. Are there a middle layer somewhere that dictates the
> > font and overrides the component font?

No, the font was stored into the database as part of the rich text when
the record was first saved.

If you want to revert the text to the control's default font you have
to use the datasets AfterScroll event to do something like this:

   dbrichedit1.SelectAll;
   dbrichedit1.SelAtttributes.Assign(dbrichedit1.Font);


-- 
Peter Below (TeamB)
0
Peter
3/7/2014 6:04:20 PM
Peter Below wrote:

<snip>
> 
> If you want to revert the text to the control's default font you have
> to use the datasets AfterScroll event to do something like this:
> 
>    dbrichedit1.SelectAll;
>    dbrichedit1.SelAtttributes.Assign(dbrichedit1.Font);

This worked too, but was much more elegant,
so now I have ditched the extra memo components and just added theese
two lines to the AfterScroll.
I learn a lot in this newsgroups.
Thank you very much, Peter!

:)
Kai Inge
0
Kai
3/8/2014 9:32:23 AM
Peter Below wrote:

<snip>
> 
>    dbrichedit1.SelectAll;
>    dbrichedit1.SelAtttributes.Assign(dbrichedit1.Font);
<snip>

Hello again.

Because of some side effects like blinking when entering the memo and
'Not in edit mode' errors when change focus, I decided to move theese
lines from the AfterScroll to the Save part.
Now I want the lines not to be executed if the font in the BLOB field
already is the right one, Courier New, at Save.
What syntax could I use to detect the font name in the BLOB? (I don't
know where in the BLOB it occours, but it should be only at the
beginning of text since it don't change.)

Thanks in advance.

:)
Kai Inge
0
Kai
4/5/2014 4:50:32 PM
Kai Inge Buseth wrote:

> Peter Below wrote:
> 
> <snip>
> > 
> >    dbrichedit1.SelectAll;
> >    dbrichedit1.SelAtttributes.Assign(dbrichedit1.Font);
> <snip>
> 
> Hello again.
> 
> Because of some side effects like blinking when entering the memo and
> 'Not in edit mode' errors when change focus, I decided to move theese
> lines from the AfterScroll to the Save part.
> Now I want the lines not to be executed if the font in the BLOB field
> already is the right one, Courier New, at Save.
> What syntax could I use to detect the font name in the BLOB? (I don't
> know where in the BLOB it occours, but it should be only at the
> beginning of text since it don't change.)
> 
  dbrichedit1.selstart := 0;
  dbrichedit1.sellength := 1;
  ... examine the properties of dbrichedit1.SelAttributes



-- 
Peter Below (TeamB)
0
Peter
4/6/2014 8:35:21 AM
Peter Below wrote:

> Kai Inge Buseth wrote:
> 
> > Peter Below wrote:
> > 
> > <snip>
> > > 
> > >    dbrichedit1.SelectAll;
> > >    dbrichedit1.SelAtttributes.Assign(dbrichedit1.Font);
> > <snip>
> > 
> > Hello again.
> > 
> > Because of some side effects like blinking when entering the memo
> > and 'Not in edit mode' errors when change focus, I decided to move
> > theese lines from the AfterScroll to the Save part.
> > Now I want the lines not to be executed if the font in the BLOB
> > field already is the right one, Courier New, at Save.
> > What syntax could I use to detect the font name in the BLOB? (I
> > don't know where in the BLOB it occours, but it should be only at
> > the beginning of text since it don't change.)
> > 
>   dbrichedit1.selstart := 0;
>   dbrichedit1.sellength := 1;
>   ... examine the properties of dbrichedit1.SelAttributes

Thank you, Peter.

That worked and I believe that in a multifont text I can iterate it and
detect where the font changes by increasing the selstart
and using the same SelAttributes detection.

:)
Kai Inge
0
Kai
4/6/2014 9:48:16 PM
Reply:

Similar Artilces:

font!font!font!
Name: robbie Product: Firefox Summary: font!font!font! Comments: Firefox font is bad !Very bad! The only reason I don't want to use firefox is font problem . I know how to change the font on firefox but it just not good enough. Internet explorer font is excellent.It also the only thing better than firefox. Browser Details: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Foxy/1; .NET CLR 1.1.4322) ...

Font font = new Font
i am not sure if when i use   Font font = new Font("Free 3 of 9", 16); // Free 3 of 9 is a bar code Font   in my code if the end user does not have that font will it still reder corecly if i use it on a dinamicly generated grephic you know the code will allways work I supose you're trying to create an image with a barcode to print it and then read the barcode. Read this article. If your ASP.NET server has the font installed and you create an Image using that font, the client machine doesn't have to install it. I tried that some time ago, but the barcode...

System Font (Small Fonts
Hi, How to find system font('Font Size' property on settings tab) from system display properties. Whether it is a 'small fonts' or 'large fonts'? Thanks, Jeff http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/q137/5/56.asp&NoWebContent=1 There's actually a bug in that code, though, so you might want to use something like this instead: http://www.mvps.org/vcfaq/sdk/18.htm On 15 Sep 2003 09:03:17 -0700, Jeff wrote: >Hi, > > How to find system font('Font Size' prop...

Increasing font in Delphi editor
Hello! I got new 64 bit machine with Win7 and installed Delphi XE. I have a large screen and therefore want to have fonts larger. So I increased screan resolution to medium (125%). Everything works fine, I have larger fonts for menu options in Delphi, I can increase font for writing the code in Delphi Editor, but I cannot increase size of font in Tabs (place where names of open units are displayed and I can select one of them by clicking on a tab. Here font is tiny and hardly visible. Any solution? Thanks in advance. That is the problem that bothers me for a long time. I would be...

superreview requested: [Bug 170854] Japanese font face is displayed different depends on OS locale : [Attachment 204765] Always use Lucida as "System" font
YAMASHITA Makoto <makotoy@ms.u-tokyo.ac.jp> has asked Brian Ryner <bryner@brianryner.com> for superreview: Bug 170854: Japanese font face is displayed different depends on OS locale https://bugzilla.mozilla.org/show_bug.cgi?id=170854 Attachment 204765: Always use Lucida as "System" font https://bugzilla.mozilla.org/attachment.cgi?id=204765&action=edit ...

superreview cancelled: [Bug 170854] Japanese font face is displayed different depends on OS locale : [Attachment 204765] Always use Lucida as "System" font
YAMASHITA Makoto <makotoy@ms.u-tokyo.ac.jp> has cancelled YAMASHITA Makoto <makotoy@ms.u-tokyo.ac.jp>'s request for superreview: Bug 170854: Japanese font face is displayed different depends on OS locale https://bugzilla.mozilla.org/show_bug.cgi?id=170854 Attachment 204765: Always use Lucida as "System" font https://bugzilla.mozilla.org/attachment.cgi?id=204765&action=edit ...

superreview requested: [Bug 170854] Japanese font face is displayed different depends on OS locale : [Attachment 204765] Always use Lucida as "System" font #2
YAMASHITA Makoto <makotoy@ms.u-tokyo.ac.jp> has asked Mike Pinkerton <mikepinkerton@mac.com> for superreview: Bug 170854: Japanese font face is displayed different depends on OS locale https://bugzilla.mozilla.org/show_bug.cgi?id=170854 Attachment 204765: Always use Lucida as "System" font https://bugzilla.mozilla.org/attachment.cgi?id=204765&action=edit ...

superreview granted: [Bug 408965] [10.5] cmaps for fonts with Unicode-platform format-12 cmaps are not read : [Attachment 308663] Use STHeiti to replace Hei as the default font
Stuart Parmenter <pavlov@pavlov.net> has granted John Daggett (:jtd) <jdaggett@mozilla.com>'s request for superreview: Bug 408965: [10.5] cmaps for fonts with Unicode-platform format-12 cmaps are not read https://bugzilla.mozilla.org/show_bug.cgi?id=408965 Attachment 308663: Use STHeiti to replace Hei as the default font https://bugzilla.mozilla.org/attachment.cgi?id=308663&action=edit ------- Additional Comments from Stuart Parmenter <pavlov@pavlov.net> seems ok? ...

superreview requested: [Bug 408965] [10.5] cmaps for fonts with Unicode-platform format-12 cmaps are not read : [Attachment 308663] Use STHeiti to replace Hei as the default font
John Daggett (:jtd) <jdaggett@mozilla.com> has asked Stuart Parmenter <pavlov@pavlov.net> for superreview: Bug 408965: [10.5] cmaps for fonts with Unicode-platform format-12 cmaps are not read https://bugzilla.mozilla.org/show_bug.cgi?id=408965 Attachment 308663: Use STHeiti to replace Hei as the default font https://bugzilla.mozilla.org/attachment.cgi?id=308663&action=edit ------- Additional Comments from John Daggett (:jtd) <jdaggett@mozilla.com> I think we should try to get this in for B5. ...

superreview requested: [Bug 396137] port Windows font matching code to Mac and use in place of ATSUI font matching : [Attachment 292750] patch, v1.2, cmap font matching fix
John Daggett (:jtd) <jdaggett@mozilla.com> has asked Stuart Parmenter <pavlov@pavlov.net> for superreview: Bug 396137: port Windows font matching code to Mac and use in place of ATSUI font matching https://bugzilla.mozilla.org/show_bug.cgi?id=3D396137 Attachment 292750: patch, v1.2, cmap font matching fix https://bugzilla.mozilla.org/attachment.cgi?id=3D292750&action=3Dedit ------- Additional Comments from John Daggett (:jtd) <jdaggett@mozilla.com> Tested patch, ready for inspection. I haven't done a lot of optimization on this yet, specifically I haven&...

superreview denied: [Bug 396137] port Windows font matching code to Mac and use in place of ATSUI font matching : [Attachment 292750] patch, v1.2, cmap font matching fix
Stuart Parmenter <pavlov@pavlov.net> has denied John Daggett (:jtd) <jdaggett@mozilla.com>'s request for superreview: Bug 396137: port Windows font matching code to Mac and use in place of ATSUI font matching https://bugzilla.mozilla.org/show_bug.cgi?id=3D396137 Attachment 292750: patch, v1.2, cmap font matching fix https://bugzilla.mozilla.org/attachment.cgi?id=3D292750&action=3Dedit ------- Additional Comments from Stuart Parmenter <pavlov@pavlov.net> Overall, this looks pretty good. Some comments:=0D =0D -/* -*- Mode: C++; tab-width: 20; indent-tabs-...

superreview cancelled: [Bug 246527] Missing fonts in font menu / GfxMac ignores some fonts (nsDeviceContextMac :: InitFontInfoList() is broken) : [Attachment 215097] font manager patch
YAMASHITA Makoto <makotoy@ms.u-tokyo.ac.jp> has cancelled Darin Fisher (Google) <darin@meer.net>'s request for superreview: Bug 246527: Missing fonts in font menu / GfxMac ignores some fonts (nsDeviceContextMac :: InitFontInfoList() is broken) https://bugzilla.mozilla.org/show_bug.cgi?id=246527 Attachment 215097: font manager patch https://bugzilla.mozilla.org/attachment.cgi?id=215097&action=edit ...

superreview requested: [Bug 246527] Missing fonts in font menu / GfxMac ignores some fonts (nsDeviceContextMac :: InitFontInfoList() is broken) : [Attachment 215097] font manager patch
Darin Fisher (Google) <darin@meer.net> has asked for superreview: Bug 246527: Missing fonts in font menu / GfxMac ignores some fonts (nsDeviceContextMac :: InitFontInfoList() is broken) https://bugzilla.mozilla.org/show_bug.cgi?id=246527 Attachment 215097: font manager patch https://bugzilla.mozilla.org/attachment.cgi?id=215097&action=edit ...

superreview requested: [Bug 216456] 'font' with system font keyword and ' font-family' with generic font family keyword behaving incorrectly
David Baron [:dbaron] <dbaron@mozilla.com> has asked Boris Zbarsky (not available till July 4) <bzbarsky@mit.edu> for superreview: Bug 216456: 'font' with system font keyword and 'font-family' with generic font family keyword behaving incorrectly https://bugzilla.mozilla.org/show_bug.cgi?id=216456 Attachment 271007: patch https://bugzilla.mozilla.org/attachment.cgi?id=271007&action=edit ------- Additional Comments from David Baron [:dbaron] <dbaron@mozilla.com> We can't stomp on aFont as temporary storage because it's sometimes the only...

Web resources about - Delphi Editor font and TDBRichEdit font gives different results with same font. (Courier New 10) - embarcadero.delphi.vcl.using

Resources last updated: 12/20/2015 8:18:49 AM