[Xerte] Re: Speaking of MarkWord

Julian Tenney Julian.Tenney at nottingham.ac.uk
Tue Jan 25 22:44:09 GMT 2011


I thought so. If I could have done this with styles whenI wanted to, I would have. The best code I have is the one that positions the snippets dialog when you press CTRl-SHIFT. It should position the dialog at the caret.


________________________________________
From: xerte-bounces at lists.nottingham.ac.uk [xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Patrick Lockley [Patrick.Lockley at nottingham.ac.uk]
Sent: 25 January 2011 20:18
To: Xerte discussion list
Subject: [Xerte] Re: Speaking of MarkWord

get the text extent of the string up and until the letter before Dave

Then the text extent of the string after e

Then hope no one changes text size.
________________________________________
From: xerte-bounces at lists.nottingham.ac.uk [xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Dave Burnett [d_b_burnett at hotmail.com]
Sent: Tuesday, January 25, 2011 6:24 PM
To: Xerte list
Subject: [Xerte] Re: Speaking of MarkWord

No.
I'm sure it's just not within Flash's tiny html subset.

I'm not sure how to apply getTextExtent() here.
Doesn't that just give me the general metrics for the TF?
e.g. how do I get to x,y of D in Dave in some long string?


________________________________
From: Patrick.Lockley at nottingham.ac.uk
To: xerte at lists.nottingham.ac.uk
Date: Tue, 25 Jan 2011 18:12:02 +0000
Subject: [Xerte] Re: Speaking of MarkWord


Hmmmm, try this Shirley



<p style=”background-color:#ff0000”><a blaaaah></a></p>



From: xerte-bounces at lists.nottingham.ac.uk [mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Dave Burnett
Sent: 25 January 2011 17:57
To: Xerte list
Subject: [Xerte] Re: Speaking of MarkWord



No diff.

And don't call me Shirley.

________________________________

From: Patrick.Lockley at nottingham.ac.uk
To: xerte at lists.nottingham.ac.uk
Date: Tue, 25 Jan 2011 17:25:06 +0000
Subject: [Xerte] Re: Speaking of MarkWord

a style="background-colour#ffff00" surely?



None of that firefox freaky stuff here thank you very much



________________________________

From: xerte-bounces at lists.nottingham.ac.uk [xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Dave Burnett [d_b_burnett at hotmail.com]
Sent: Tuesday, January 25, 2011 5:12 PM
To: Xerte list
Subject: [Xerte] Re: Speaking of MarkWord


<a STYLE="background-color: rgb(255,255,0)" href="asfunct

Nothing. :-(

Daa.



________________________________

From: Julian.Tenney at nottingham.ac.uk
To: xerte at lists.nottingham.ac.uk
Date: Tue, 25 Jan 2011 17:05:03 +0000
Subject: [Xerte] Re: Speaking of MarkWord

Can you set the background via CSS? That would be much easier as then you could use styles and string.replace(), dropping in html to set the styles. However, I suspect not…



Otherwise you have to use getTextExtent() to



-- find the metrics of the end of the string leading up to the word you want to highlight – so you know where to start drawing

-- work out the w and h of the actual word, so you knowhow wide / deep to draw

-- draw the rect somewhere

-- loop over the string looking for match.



Be a useful engine method, because you’ll be wanting a few functions to do this tidily.



From: xerte-bounces at lists.nottingham.ac.uk [mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Julian Tenney
Sent: 25 January 2011 16:54
To: Xerte discussion list
Subject: [Xerte] Re: Speaking of MarkWord



Difficult bugger.



From: xerte-bounces at lists.nottingham.ac.uk [mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Dave Burnett
Sent: 25 January 2011 16:54
To: Xerte list
Subject: [Xerte] Re: Speaking of MarkWord



Highlighter.

________________________________

From: Julian.Tenney at nottingham.ac.uk
To: xerte at lists.nottingham.ac.uk
Date: Tue, 25 Jan 2011 16:50:45 +0000
Subject: [Xerte] Re: Speaking of MarkWord

You want to draw a rectangle behind it, like a highlighter, or just make the text a different colour?



From: xerte-bounces at lists.nottingham.ac.uk [mailto:xerte-bounces at lists.nottingham.ac.uk] On Behalf Of Dave Burnett
Sent: 25 January 2011 16:47
To: Xerte list
Subject: [Xerte] Speaking of MarkWord



Xerte 2 desktop.

I don't need any interactivity, just a way to highlight a word or words in a string:
e.g. I would like this [word] to have a yellow highlight.

Method already exist?

Cheers;

Dave

This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham.
This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation.

_______________________________________________ Xerte mailing list Xerte at lists.nottingham.ac.uk http://lists.nottingham.ac.uk/mailman/listinfo/xerte This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation.

_______________________________________________ Xerte mailing list Xerte at lists.nottingham.ac.uk http://lists.nottingham.ac.uk/mailman/listinfo/xerte This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation.

_______________________________________________ Xerte mailing list Xerte at lists.nottingham.ac.uk http://lists.nottingham.ac.uk/mailman/listinfo/xerte This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation.

_______________________________________________ Xerte mailing list Xerte at lists.nottingham.ac.uk http://lists.nottingham.ac.uk/mailman/listinfo/xerte This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation.

_______________________________________________
Xerte mailing list
Xerte at lists.nottingham.ac.uk
http://lists.nottingham.ac.uk/mailman/listinfo/xerte


More information about the Xerte mailing list