* Problem with Paste Unformatted Text

Questions regarding use of any Version of Family Historian. Please ensure you have set your Version of Family Historian in your Profile. If your question fits in one of these subject-specific sub-forums, please ask it there.
User avatar
davidf
Megastar
Posts: 951
Joined: 17 Jan 2009 19:14
Family Historian: V6.2
Location: UK

Re: Problem with Paste Unformatted Text

Post by davidf » 14 Dec 2022 15:04

tatewise wrote:
14 Dec 2022 14:47
But those characters can be rendered in the plain text editor ~ as I've said several times.
...
Furthermore, the font-switching chooses 'Segoe UI Symbol' font which is not a monospace font.
Yes, but ... we don't know how the paste functionality works (other than it is probably OS library code)

It might be that it looks at the buffer, sees (in my case DejaVu Sans Mono) "thinks, I can't render that", so font-switches to something it feels confident about (and Segoe UI ... seems to be the Windows fall-back), then it starts examining the characters ...)
tatewise wrote:
14 Dec 2022 14:47
(Simply remove the font-switching codes in the Ctrl+Alt [...] plain text editor and they render just fine. )
If by that you mean have a sort of "clean up routine" when a plain text editor field "loses focus", it should work except where the characters previously wrapped in the font-switching tags can't be rendered in the default font - in which case you get the "font-failure" symbol, which seems to be a square. That would be acceptable to me - If you don't like the squares, undo and save as "Rich Text" - its a kludge to solve a problem we don't seem able to "solve" at source.
David
Running FH 6.2.7. Under Wine on Linux (Ubuntu 22.04 LTS + LXDE 11)

User avatar
ColeValleyGirl
Megastar
Posts: 4853
Joined: 28 Dec 2005 22:02
Family Historian: V7
Location: Cirencester, Gloucestershire
Contact:

Re: Problem with Paste Unformatted Text

Post by ColeValleyGirl » 14 Dec 2022 16:01

davidf wrote:
14 Dec 2022 15:04
If by that you mean have a sort of "clean up routine" when a plain text editor field "loses focus", it should work except where the characters previously wrapped in the font-switching tags can't be rendered in the default font - in which case you get the "font-failure" symbol, which seems to be a square. That would be acceptable to me - If you don't like the squares, undo and save as "Rich Text" - its a kludge to solve a problem we don't seem able to "solve" at source.
I suspect CP wouldn't write another routine for converting rich text to plain text, just reuse the one in their Gedcom export facility. So we could if we wish experiment with that to see what the outcome would be.

User avatar
tatewise
Megastar
Posts: 27078
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Problem with Paste Unformatted Text

Post by tatewise » 14 Dec 2022 16:19

ColeValleyGirl wrote:
14 Dec 2022 16:01
I suspect CP wouldn't write another routine for converting rich text to plain text, just reuse the one in their Gedcom export facility. So we could if we wish experiment with that to see what the outcome would be.
I've performed that experiment and the unwanted font format codes get stripped.
So why doesn't CP adjust FH so that routine gets used after Paste Unformatted Text is used?
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
ColeValleyGirl
Megastar
Posts: 4853
Joined: 28 Dec 2005 22:02
Family Historian: V7
Location: Cirencester, Gloucestershire
Contact:

Re: Problem with Paste Unformatted Text

Post by ColeValleyGirl » 14 Dec 2022 16:21

tatewise wrote:
14 Dec 2022 16:19

So why doesn't CP adjust FH so that routine gets used after Paste Unformatted Text is used?
Do we know if the control supports the appropriate callback or equivalent? Or it is a black box as far as standard functionality goes and FH can't see when a paste has happened?

Nick will know.

(It does feel as if we're veering repeatedly into redesigning FH on the fly, and criticising coding we have no idea about... so I'm going to stop discussing possible implementation options for fixing bugs and/or introducing new functionality, and focus on finishing the Wish List request based on a set of requirements.)

User avatar
NickWalker
Megastar
Posts: 2401
Joined: 02 Jan 2004 17:39
Family Historian: V7
Location: Lancashire, UK
Contact:

Re: Problem with Paste Unformatted Text

Post by NickWalker » 14 Dec 2022 16:25

I'm not sure I understand. Can you very carefully explain what you want to happen when 'unformatted text' is pasted into the Rich Text box?
Nick Walker
Ancestral Sources Developer

https://fhug.org.uk/kb/kb-article/ancestral-sources/

User avatar
tatewise
Megastar
Posts: 27078
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Problem with Paste Unformatted Text

Post by tatewise » 14 Dec 2022 16:33

Now here is an interesting experiment.
Copy one line of Bill's webpage that he posted originally and paste it into a Citation 'Where Within' box.
Guess what? It gets pasted as unformatted text with no format codes and all the symbols look just fine.

I cannot believe that the long-text box right-click functions are entirely implemented by some OS library.
Some of them such as Paste with Website Link and Lookup 'xyx' in Dictionary... must be handled by FH directly.
So why can't FH handle Paste Unformatted Text and use the short-text paste routine (but allow newline chars).
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
BillH
Megastar
Posts: 2179
Joined: 31 May 2010 03:40
Family Historian: V7
Location: Washington State, USA

Re: Problem with Paste Unformatted Text

Post by BillH » 14 Dec 2022 16:46

Mark1834 wrote:
14 Dec 2022 12:06
It's worth noting as well that while Bill's example is good evidence for the experts to follow up, it is not the only cause of font contamination. I am 100% certain that it also occurs just when dealing with plain ASCII standard characters.

I haven't yet managed to determine precisely the circumstances to generate a reproducible example, and I treat it as an occasional annoyance that I deal with as I spot it (but clearly missed quite a few examples when I searched the GEDCOM :)). Hopefully this enhanced level of attention will help CP understand what's going on.
Yes, I have also seen cases where the text is entirely just alpha text with no formatting and no unusual characters.

Bill

User avatar
BillH
Megastar
Posts: 2179
Joined: 31 May 2010 03:40
Family Historian: V7
Location: Washington State, USA

Re: Problem with Paste Unformatted Text

Post by BillH » 14 Dec 2022 16:51

NickWalker wrote:
14 Dec 2022 12:33
I am making extensive use of rich-text for my sources so I'll expect my text to have formatting in it, so a few font changes to allow symbols to be displayed doesn't really make any difference to me.
The thing is that the font doesn't have to be changed to display those symbols. They display just fine in Tahoma. I would prefer that the font is not changed to something else. If I had wanted Segoe I would have set that as my default.

Bill
Last edited by BillH on 14 Dec 2022 17:54, edited 1 time in total.

User avatar
NickWalker
Megastar
Posts: 2401
Joined: 02 Jan 2004 17:39
Family Historian: V7
Location: Lancashire, UK
Contact:

Re: Problem with Paste Unformatted Text

Post by NickWalker » 14 Dec 2022 16:52

tatewise wrote:
14 Dec 2022 16:33
Now here is an interesting experiment.
Copy one line of Bill's webpage that he posted originally and paste it into a Citation 'Where Within' box.
Guess what? It gets pasted as unformatted text with no format codes and all the symbols look just fine.

I cannot believe that the long-text box right-click functions are entirely implemented by some OS library.
Some of them such as Paste with Website Link and Lookup 'xyx' in Dictionary... must be handled by FH directly.
So why can't FH handle Paste Unformatted Text and use the short-text paste routine (but allow newline chars).
Please can you explain step-by-step what you're suggesting should happen when Paste Unformatted Text is used to paste text into a rich-text box?
Nick Walker
Ancestral Sources Developer

https://fhug.org.uk/kb/kb-article/ancestral-sources/

User avatar
NickWalker
Megastar
Posts: 2401
Joined: 02 Jan 2004 17:39
Family Historian: V7
Location: Lancashire, UK
Contact:

Re: Problem with Paste Unformatted Text

Post by NickWalker » 14 Dec 2022 16:57

BillH wrote:
14 Dec 2022 16:51
NickWalker wrote:
14 Dec 2022 12:33
I am making extensive use of rich-text for my sources so I'll expect my text to have formatting in it, so a few font changes to allow symbols to be displayed doesn't really make any difference to me.
The thing is that the font doesn't have to be changed to display those symbols. The display just fine in Tahoma. I would prefer that the font is not changed to something else. If I had wanted Segoe I would have set that as my default.

Bill
I agree Bill, but it's the rich-text control adding that, not anything that I'm doing (or CP).
Nick Walker
Ancestral Sources Developer

https://fhug.org.uk/kb/kb-article/ancestral-sources/

User avatar
tatewise
Megastar
Posts: 27078
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Problem with Paste Unformatted Text

Post by tatewise » 14 Dec 2022 17:11

NickWalker wrote:
14 Dec 2022 16:52
Please can you explain step-by-step what you're suggesting should happen when Paste Unformatted Text is used to paste text into a rich-text box?
I am assuming that FH is able to intercept each right-click option that is chosen. Maybe that is where the idea breaks down.
However, I would be surprised if the Paste Citation and Add Link options are handled by some OS library.
If FH can intercept the Paste Unformatted Text option then it invokes the short-text paste routine.
The supplied parameter is the clipboard and a new option to allow newline characters to be retained.
The returned text is the desired plain text with no formatting. That text is inserted into the rich text at the cursor.

The same strategy would apply to Ctrl+Shft+V if that got implemented.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
BillH
Megastar
Posts: 2179
Joined: 31 May 2010 03:40
Family Historian: V7
Location: Washington State, USA

Re: Problem with Paste Unformatted Text

Post by BillH » 14 Dec 2022 17:19

NIck,

Yes, as I said earlier, I agree that it may be nothing CP can correct. It may be a Microsoft problem. Since I have a mix of rich text and plain text notes, text from source, etc., it would be nice if there was an easy way to not get this font corruption. I was hoping that Paste Unfomatted Text would do the trick. I did create the ticket with CP, hopefully I'll hear back soon from them.

Bill

User avatar
NickWalker
Megastar
Posts: 2401
Joined: 02 Jan 2004 17:39
Family Historian: V7
Location: Lancashire, UK
Contact:

Re: Problem with Paste Unformatted Text

Post by NickWalker » 14 Dec 2022 17:24

tatewise wrote:
14 Dec 2022 17:11
I am assuming that FH is able to intercept each right-click option that is chosen. Maybe that is where the idea breaks down.
However, I would be surprised if the Paste Citation and Add Link options are handled by some OS library.
If FH can intercept the Paste Unformatted Text option then it invokes the short-text paste routine.
The supplied parameter is the clipboard and a new option to allow newline characters to be retained.
The returned text is the desired plain text with no formatting. That text is inserted into the rich text at the cursor.

The same strategy would apply to Ctrl+Shft+V if that got implemented.
All the right-click and pasting stuff is handled by FH. But I think what is happening is that the rich-text control insists on inserting the font reference as soon as the character is put in. So you can strip it all out as much as you like but as soon as it appears in the control the font will be put in. Certainly in the .Net implementation that I use it really is a law onto itself and I don't have access to low enough level routines to stop it doing that. (I will do some experimenting to confirm that). I think CP probably use C++ and so may have access to the control at a lower level than I do so that's for them to look at. But I'm not convinced this is as easy as you suggest.
Nick Walker
Ancestral Sources Developer

https://fhug.org.uk/kb/kb-article/ancestral-sources/

User avatar
tatewise
Megastar
Posts: 27078
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Problem with Paste Unformatted Text

Post by tatewise » 14 Dec 2022 17:44

So it should work when Paste Unformatted Text is applied to an empty (or plain text) Note box, before opening the editor, because at that point the rich text control should not be invoked.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
NickWalker
Megastar
Posts: 2401
Joined: 02 Jan 2004 17:39
Family Historian: V7
Location: Lancashire, UK
Contact:

Re: Problem with Paste Unformatted Text

Post by NickWalker » 14 Dec 2022 18:31

tatewise wrote:
14 Dec 2022 17:44
So it should work when Paste Unformatted Text is applied to an empty (or plain text) Note box, before opening the editor, because at that point the rich text control should not be invoked.
But the small note box is a rich text editor (it just doesn't have a tool bar) so it would do the same thing. I agree it would be fine to paste into a plain text box (I've already told you that), but a plain text box is not available to the end user unless they know the magic commands to invoke it.
Nick Walker
Ancestral Sources Developer

https://fhug.org.uk/kb/kb-article/ancestral-sources/

User avatar
BillH
Megastar
Posts: 2179
Joined: 31 May 2010 03:40
Family Historian: V7
Location: Washington State, USA

Re: Problem with Paste Unformatted Text

Post by BillH » 14 Dec 2022 18:33

I just got the standard response from CP.

"OK - I have logged the issue. It will be passed to the developers for evaluation."

Bill

Post Reply