[AccessD] Moving on to Fonts
John Colby
jwcolby at gmail.com
Tue Jul 12 21:29:53 CDT 2022
I understand no 'face' tag. I am dealing with the <Font face="XYZ"> And
yes, I am no expert.
I programmatically build up an html string. As an actual example:
<u><i><Font Size=4><Font Face="Impact"><Font Color="#0000FF">This is yet
another FONT test</Font></Font></Font></i></u>
Question, do I need three 'close font' tags or just one? I am building up
one for each font property at the beginning of the string. My ignorance of
the subject is legendary.
It displays "correctly" whatever that might mean. It displays, it can
display color, it can change fonts etc.
When I set the text control to that, it displays. When I pull the text
back out and write it to the debug window I get the original thing I put in
there, i.e. the string above.
BNow... the used can (as you noted) click in the text box and swipe
something. Change the color, change the font etc. Visibly, in the
control, I can see the changes. I can click out of the control, change to
another tab and look at a similar text box displaying other stuff. Come
back and the changes I made with that toolbar editor are still there.
The text control is unbound. Via my class I can get the contents of the
text box and print it to the debug window. That is precisely where the
line above came from. That is text, true, but it is also HTML which I
originally wrote into the text box, and which the text box rendered as
colored text with a specific font.
But it is exactly what I programmatically wrote, NOT what the user (me in
this case) modified the rendered display to be.
So,,, The html I pushed into the text box rendered. The tool bar editor
can change that, and as long as I do not close the form, the text box
continues to render the changes, even if I move to another tab and then
come back, but... the contents of the text property remain what I
programmatically wrote, not what the little editor thingie on the toolbar
wrote. I might be able to store the results into a table of RTF long text
fields. Not sure, haven't tried yet.
Thus what I wrote originally, the text box stores my html into a "render
storage", which the little toolbar can change, but the little toolbar
thingie does not affect the text box text property, it affects the "render
storage" area.
Knowing that I am not an expert, nor do I play one on TV. I am just one
step closer than anyone else I have found. At least I have a class which I
can programmatically build out html and get it to render in the text
control.
I am now trying to expand the number of fonts, with no success. TBH I was
hoping to be able to read the changes back out to 'discover' the font face
tag they were creating. I know that I can use the English language string
of a font name and *sometimes* it works, but other times it does not. But
the toolbar editor can use that exact same font that I cannot. It renders
for the toolbar editor but not for me.
I was dead certain that you were going to write a little function which
would hand me back a font translator! 🤔😁
On Tue, Jul 12, 2022 at 9:41 PM Stuart McLachlan <stuart at lexacorp.com.pg>
wrote:
>
>
>
> On 12 Jul 2022 at 20:41, John Colby wrote:
>
> > Since I have Stuart's attention...
> >
> > When I put up a line of text, I can use the face html tag and use a
> > small selection of fonts.
>
> There is no "face tag". in HTML. "face" is an attribute of the "font" tag
> :)
> Not sure what you mean by "put up a line of text".
>
> >
> > When I click in the control, the editor allows me to edit the font to
> > any font on my computer (it appears). However, the html in the
> > control itself does not change, IOW if I read it back out of the text
> > box and print it to the debug window, it is still what I wrote in
> > there. But the display shows what I did to it in the editor on the
> > tool bar.
>
> Do you mean you copy/paste into the debug window?
> In that situation, Access just copies the plain text to the clipboatrd,
> not the formatted HTML.
>
> >
> > It is as if the control stores what I write into it somewhere else,
> > but keeps the "text" property as what I wrote. then if I edit it with
> > that little editor, it stores that somewhere and displays THAT.
>
> No, the full HTML is stored in the field. Your problem is that whatever
> you are doing is not
> getting that actual field's content, it is just getting the text without
> the markup.
>
> Here's a demo of getting the actual sotred HTML:
>
> Function Test() As String
> Dim rs As DAO.Recordset
> Set rs = CurrentDb.OpenRecordset("Table2")
> Dim s As String
> rs.MoveFirst
> Debug.Print rs!RTF
> Debug.Print
> Test = rs!RTF
> End Function
> ==========================================
> ? test
> <div><font face=Algerian>This is a rich </font><font face=Algerian
> color="#ED1C24">text</font><font face=Algerian> field</font></div>
>
> <div><font face=Algerian>This is a rich </font><font face=Algerian
> color="#ED1C24">text</font><font face=Algerian> field</font></div>
>
>
> >
>
> >
> > Bizarre functionality.
> >
> > My question to those more knowledgeable than I, Is there any way to
> > actually use those other fancy fonts with my <font face = FontX> tag.
> > I understand the limitations of "what is on MY computer" but still. I
> > am totally unable to display things other than bog standard.
> >
> > --
> > John W. Colby
> > Colby Consulting
> > --
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > https://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> >
>
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> https://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
--
John W. Colby
Colby Consulting
More information about the AccessD
mailing list