Enhance: add ability to set any glyph as a room symbol#1543
Conversation
(Actually it is possible to use a short word as well as anything printable from any of the Unicode Multiple Planes.) Adds controls to the profile preference to set the (preferred) font to use to set the room symbols from and a checkbox to only use that font. Additionally a sub-dialog can be brought up which lists the details of all the different symbols on the map - showing the Unicode codepoint(s) for each and showing how they would be rendered if only the selected font is used and if any font is permitted, along with a count of the usages and the rooms that use each one... A status icon is also displayed showing whether the symbol can be rendered entirely with the selected font (green tick), only by using glyphs from other fonts (yellow ! warning) or not with the current fonts on the system (red/white cross). This allows a user to make a sensible selection of a font to use or whether they will have a problem (and a replacement by the replacement character '�') for any symbols. Updates Lua setRoomChar and getRoomChar and adds replacement setRoomSymbol and getRoomSymbol which handle the wider range of things that can be used. getRoomChar will now return '?' and an error message if the symbol cannot be represented by a single ASCII/ISO 8859-1 character - but will still work for old maps as before - although it NOW allows for an existing character to be cleared with an empty string or a space as the char attribute. The map format version has been incremented to allow the data needed to be saved directly into the binary file format but failback code is in place that means that this feature can be carried in map and room user data instead for map format versions down to 17 - the current default is 18 and there is limited support to fail gracefully down to the 16 that Mudlet 2.1 uses (all the room letter markings that are not supported will become '?', and the font data will be lost, but the correct room character data will still be in the room user data.) Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
|
Note that this also works on round rooms - the pixmaps do have to be scaled down by a 0.707 factor to allow for them to fit inside the small extremes compared to the rectangle - but this code does not force rectangular/square rooms on those with letters/symbols as the prior code did. Also note that Map Format 19 is not stable - I do have another separate PR in mind to give each room a persistent Uuid (Universally unique identification number) on creation which should make it easier to track changes between divergent versions of shared binary maps - as it will be easier to see which rooms have been added/modified/removed between two copies. However that will also need to store a |
So was causing compilation failures where used in T2DMap::painEvent(...) for older Qt versions. Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
|
Logged a bug report QTBUG-66204 because they did not mention that |
So to test for Qt 5.10.0 the value to test is 0x050a00 NOT 0x051000 ...! Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
|
1). I think it would be fair to say eventually in the Wiki that Emojis can be used but that is not the right word to describe the massively huge proportions of other glyphs that can be used - Emojis are only one type of ideograms and they are separate from logograms and phonograms that make up the symbols for Chinese (and others) and Roman languages respectively. 2). What is happening on that dialog? I can't see anything and I'd expect to see some content in a normal font in the other columns - it is only the two that show the glyphs that have non-standard font setting! Stick some ordinary letters in your map. I don't suppose that you are using an XML map format which does not currently support room symbols/letters? 3). What font are you specifically selecting - I have got some really poor results from some ropey bitmap fonts because I suspect the font matching routine tries to use glyphs from "other" fonts to fill in for missing ones from the selected one based at least partly on size in some aspect... it is possible that we might want to experiment in using |
src/TLuaInterpreter.cpp
Outdated
| } | ||
| } | ||
|
|
||
| int TLuaInterpreter::setRoomSymbol(lua_State* L) |
There was a problem hiding this comment.
Why not just upgrade setRoomChar()? By introducing a separate function, we'll force everybody to migrate their calls to it, and then people will be getting confused between two very similar functions - not fun.
There was a problem hiding this comment.
Well it is no longer a "char" a single ASCII/ISO 8859-1 byte/character - and that can break scripts using the getter which is also a no-no isn't it? I've provided backwards compatibility - getRoomChar will return ? if the symbol is not one that is expressible in that byte form...
There was a problem hiding this comment.
I think the chances of breaking scripts are pretty minimal, because we're going from one character to many and I don't think anyone would be triple-checking that the character(s) they get back are strictly ISO 8859-1 and erroring if it's anything else. Your thoughts, @keneanung?
We make use of getRoomChar() in the IRE mapping script and I think that will still work fine. Searching on Github shows that our script is the only public script that actually makes use of that function.
There was a problem hiding this comment.
This is still a point, I'm not a fan of telling people "yeah there's two ways you can set a symbol on a map good luck memorizing the right one"
There was a problem hiding this comment.
I thought the discussion was that "Symbol" was the most obvious/best term to use and setRoomChar is no longer a good fit for the term as - although neither implies a plural usage the way things are handled in the display usage does treat say the term where is it a word "shop" as a specific "symbol" and "cafe" and "café" as two different ones...
I would want to flag setRoomChar as deprecated in the Wiki and for the current usage by the IRE scripts it would continue to do what it says it does (although it is now possible to clear the symbol which was not before!) - and we'd follow the previous behaviour in that if the setRoomSymbol function exists use it (you've always said that scripter should "test for a function rather than relying on a version number" 😮 ) otherwise fall-back to setRoomChar but it only accepts a single ASCII character...
src/T2DMap.cpp
Outdated
| void T2DMap::addSymbolToPixmapCache( const QString key ) | ||
| { | ||
| QPixmap * pix = new QPixmap(mapLetterPixmapSize,mapLetterPixmapSize); | ||
| pix->fill( QColor(0,0,0,0) ); // Fill with a *transparent* background! |
Is there any way to add colour to them? |
Replaced some colour specifications (white and transparent) with Qt
constants.
Use the same inline function flushSymbolPixmapCache() to clear the map
symbol pixmap cache in all places where it might be useful.
Simplify a couple of places where an if(...) {...} else {...} can be
replaced with the (...) ? (...) : (...) operator.
Limit the number of room numbers displayed for each symbol in the new
widget - to avoid complications where there are huge numbers of rooms using
a symbol.
Replace a use of QTableWidget::clearContents() with
QTableWidgets::setRowCount(0) as I was getting some odd, deep in the Qt
internal library issues {Fatal Seg. Faults!} with the former, which I
suspect, but could not prove, might have been a re-entrancy issue caused by
the method containing it being called indirectly by an asynchronous SIGNAL/
SLOT originating in the value change from the map symbol font selection
QFontComboBox...
Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
|
1). I am not happy to use a word that is less than twenty years old (according to Wikipedia) to represent a very small subset of what can be used. Character is one that people will recognise but unfortunately in this day and age, character has a degree of ambiguity; however glyphs and graphemes though not quite the same thing (the former is the representation of the latter in a particular font) are much better representations of what is involved - as it is, symbol is the replacement term I have put on the 2D mapper context menu and in the context where this is used as a specific mark or combination of marks used to designate something it is not an unreasonable choice either. 2). Ah, you said: "...with rows too small..." but you meant columns too small! I agree and I think I can fix that. I've also realised that it is not wise to include every room in the last column - because a wilderness map with symbols on every room will just make the rows very large when auto-sizing-to-contents, I'm proposing to clamp it to, say 32 rooms, with a This will still allow the usage of odd glyphs to be detected which was the intention but means that it is not a full-blown search feature {unfortunately I haven't found a way to make it possible to (context-menu) select and copy data from the dialogue, e.g. by copying the symbols or individual room numbers} so this is probably okay. 3). It is not possible to colour emojis as the Qt widgets concerned do not support {which is not surprising, really} handling/rendering of the Variation selectors that control this i.e. U+FE0E {VARIATION SELECTOR-15 (VS15)} for text or U+FE0F {VARIATION SELECTOR-16 (VS16)} for emoji style. For example of those selectors in use, one probably has to use a broswer (or perhaps Curiously, choosing the Symbola font shows those Variation Selectors as separate glyphs but as it does not contain them it is not easy to work out where those glyphs are coming from - for example, using DejaVu Sans: Using Symbola: |
|
We've gotta think about the users here - I'd argue we're making the program for them. If we were making the program just for ourselves, yeah, we'd call everything the strictly 100% semantically correct terminology that very few users would understand. We're not working with a life-and-death situation here like I do at my work, I say we can relax the semantics in favour of people understanding. That said emoji's are supposed to be coloured and if we can't get them to be coloured at all, then we shouldn't call them so. It'd be a big dissapointment. Can't we render the emoji in colour and then save that picture, and re-use it in the mapper? Also, could you show me a screenshot of how your map looks like when this is working correctly? The results I've tried haven't rendered very well. |
|
@Kebap @Ansrare @WackyWormer @keneanung you guys make use of the mapper as well, so if you could give your thoughts on this, that'd be great! |
|
I vote for "symbol". I think both "emoji" and "character" both convey a much smaller set of options than are actually available. "Glyph" is a close second, and I think many english-speakers would be somewhat familiar with the term (e.g. Egyptian hieroglyphics), but IMO its a bit too esoteric for the average user. |
|
I forgot to add the links to test this feature - they are a bit hidden. You can try this out for yourself: Windows: https://ci.appveyor.com/api/buildjobs/j662o7wkpbnf15y4/artifacts/src%2Fmudlet.zip |
|
I think I am going to have to have a play with the various |
|
Okay, sure! Show us what you come up with. |
I found that the existing triangular markings drawn on the room symbols to indicate non-XY exits (i.e. up, down, in and out) mask any glyph drawn on as a symbol because for the real exits they are completely filled in black. This commit enhances the design so that a mid shade "brush" is used instead for real exits and a light cross-hatch brush is used for stub exits. Importantly the colour used for the brush is either a contrasting black or white - the same as the pen used to draw the outline but it is now drawn in the same colour as the door markings on XY plain exits - so that doors can now be indicated on those up/down/in/out exits or stubs. The tool-tips in the room exits dialogue have been amended to suit this long-planned (by me) enhancement! The pen used to draw the outline is also made a non-zero width size. Stub in and out exits were not being properly drawn in the prior code as there was a code limitation that ended up just drawing a horizontal line. Now both stub and real exits of these types are now drawn as a PAIR of triangles, with IN exits being an inward pointing pair each around half the size of the prior one, and OUT exits being an outward pointing pair outside the IN one. I think it is more intuitive what the new versions are indicating...! Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
The old one will return that '?' but also a second return which is a string saying that it should be changed to the new one - fair enough the user/scripter won't be looking for it - but if they start seeing a '?' instead of what is seen on the map one might guess that they'd RTFM. I just dislike the naming anomaly Though, if you @keneanung, as well as Vadim insist on only keeping one pair of functions i.e. |
|
Yeah, I think so. |
|
How about a compromise: I note that there are some lua functions that are registered with a different name externally to what they are internally - and in one case this means there are two names that call the same function internally. As a bit of an aside I note that of the 303 functions that I can see declared in
Edit, updated 2018/03/11 00:30 |
…ctions Rather than have two sets of functions with one set only repeating the reduced capabilities of the previous code this commit causes the use of the old function names to be redirected to the new ones. Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
src/dlgProfilePreferences.cpp
Outdated
| "You may be able to correct this by installing an additional font using whatever " | ||
| "method is appropriate for this system or by editing the map to use a different " | ||
| "symbol. It may be possible to do the latter via a lua script using the " | ||
| "<i>getRoomSymbol</i> and <i>setRoomSymbol</i> functions.</p>"))); |
src/TLuaInterpreter.cpp
Outdated
| lua_register(pGlobalLua, "getRowCount", TLuaInterpreter::getRowCount); | ||
| lua_register(pGlobalLua, "getOS", TLuaInterpreter::getOS); | ||
| lua_register(pGlobalLua, "setRoomSymbol", TLuaInterpreter::setRoomSymbol); | ||
| lua_register(pGlobalLua, "getRoomSymbol", TLuaInterpreter::getRoomSymbol); |
There was a problem hiding this comment.
Yes you do because that is what allows the better names using the word "symbol" to be used as well as (what I want to deprecate) "char" which isn't even really a word IMVHO - both work and call the same functions - in the same way as clearWindow and clearUserWindow do.
There was a problem hiding this comment.
I don't think clearWindow and clearUserWindow is a mistake we want to repeat again.
Let's look at it from the perspective of the users, and not a developer-centric purity point of view. It's a lot simpler for the users if there's one function that does one thing instead of two that do one thing?
Imagine this conversation: "What's this function B?" "Oh it does the same thing as function A." "Oh right... that makes total sense."
There was a problem hiding this comment.
I don't think clearWindow and clearUserWindow is a mistake we want to repeat again.
I am not sure what you mean by that - perhaps it predates my starting on the Mudlet project, but this does provide a means to get past the fact that the original functions were perhaps poorly named or at least not really appropriate when their scope had been expanded beyond their original target.
As the Wiki seems to be the goto documentation for the lua API it is well within the scope of things to have the original functions be stubs that say, see *etRoomSymbol(...) and to explain in the latter that since Mudlet 3.8.0 the functions' capability are extended.
You have always said that user/scripters should test for the presence of a function to determine it's availability and like this they can do so - without us having to have both. To work with just a single ASCII character in a backwards compatible manner they can use the old names - and existing stuff will continue to work (which is essential - I've learnt that by now!) but going forward new users/scripters in the future will be guided to use the more appropriately named "symbol" ones - and if anyone asks we can say that is why there are synonymous functions ...
There was a problem hiding this comment.
I thought we already agreed there wouldn't be any backwards compatibility breaking already by upgrading roomchar's capability. What are you going for - to have roomchar be artificially limited to 1 ASCII character while roomsymbol is any unicode text?
There was a problem hiding this comment.
There is now no separate *etRoomChar(...) functions - only the new functions are in TLuaInterpreter.cpp but both sets are registered so that the old names still work in Lua scripts but called the new ones *etRoomSymbol(...) internally.
📖 I will edit the Wiki as required when this PR goes in - explaining that the revised functionality can be tested for against the new names (if that is really needed by scripters) but that the old names are left to preserve backwards compatibility...
|
@keneanung could you review the changed as well? |
This is the case. But the problem is, that this renaming is confusing the users (whom we create this software for). I was contemplating this kind of compromise as well, but explaining to a user why we have a set of functions that do exactly the same is not making the interface more intuitive. Another thing about renaming that function is making scripts work in multiple Mudlet versions becomes a PITA, especially if one function is deprecated and I don't know when it will be removed. It forces me to write stuff like |
|
Well I do not contemplate removing the old function names - until at least we have to redo things for Lua 5.2 or 5.3 because the Linux distributions no longer provide 5.1 (perhaps that will be needed for Mudlet 5.x where a major version number change would be mandated by such a backwards incompatible change) Having both *etRoomChar and *etRoomSymbol still seem to me the best way to provide the backwards compatibility that existing scripts need whilst getting away from having to point out to new users that to get/set something that a reasonable person would call a symbol they have to use something that refers to a Char... 🙍♂️ |
|
I'm not contemplating removing any function names either - breaking people's stuff is just not a cool thing to do, even on major upgrades! Given my practical experience of working with a lot of users, the confusion of having two functions will be bigger than the confusion of having something that refers to char. We might think our functions have super intuitive and clear names but to many people it's all jibberish anyway and they can't tell the difference until they memorize what each does. So I'm still in favour of just get/setRoomChar and no new functions for symbols even though we call them symbols now. Practical experience as keneanung demonstrated taught us that multiple functions confuse people. Plus, in case we're wrong on this, we could introduce the symbol functions later on. We can't however undo removing a function. |
|
(If user commentary is inappropriate, I apologize in advance for polluting the comment stream and will happily accept admonitions.) Speaking as a user and a developer, I've found it quite common to use character, glyph, and symbol interchangeably in everyday usage even among the developers in my communities, outside of specific technical discussion re: Unicode implementation and technical documentation. As a developer I can appreciate more precise terminology and in this case I would agree that glyph is the most precise for this context, and this usage seems supported even in Unicode's own documentation and glossary where symbol isn't even elevated to a specific definition. All in all, from a user perspective, it seems reasonable to me to simply retain *Char functions going forward, especially given that most platforms still provide (and most users seem to actually, er, use) a "character map" for browsing available unicode characters and glyphs. |
|
We're happy to receive feedback on all issues and PRs in Mudlet. Thanks for
your contribution and hope to hear more!
…On Tue, 27 Mar 2018, 5:11 pm Bobby Bailey, ***@***.***> wrote:
(If user commentary is appropriate, I apologize in advance for polluting
the comment stream and will happily accept admonitions.)
Speaking as a user and a developer, I've found it quite common to use
character, glyph, and symbol interchangeably in everyday usage even among
the developers in my communities, outside of specific technical discussion
re: Unicode implementation and technical documentation.
As a developer I can appreciate more precise terminology and in this case
I would agree that glyph is the most precise for this context, and this
usage seems supported even in Unicode's own documentation and glossary
where symbol isn't even elevated to a specific definition.
All in all, from a user perspective, it seems reasonable to me to simply
retain *Char functions going forward, especially given that most platforms
still provide (and most users seem to actually, er, use) a "character map"
for browsing available unicode characters and glyphs.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1543 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAGxjMNlYslLBFJsFdYZkSjzt-O2gaE3ks5tilahgaJpZM4R5c3W>
.
|
…tions Following extensive discussions it has been made clear that introducing replacements for the lua [gs]etRoomChar(...) is not going to happen. Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
…oomSymbols Resolved conflicts in: * src/TLuaInterpreter.cpp Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
vadi2
left a comment
There was a problem hiding this comment.
Awesome, thanks for this cool improvement!
|
⌚️ macOs builds are stalling (well starting then failing and re-queueing) at Travis at present - after around 12 hours one of the pair of them has succeeded but I'm having to wait for the second to conclude... 🙁 |
|
Finally in! Sorry it took so long. Onto the next thing!
…On Wed, Mar 28, 2018 at 2:06 PM Stephen Lyons ***@***.***> wrote:
Merged #1543 <#1543>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1543 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAGxjHrBHyTWZbiK5mgP2Z_LaHhOBuwgks5ti4rHgaJpZM4R5c3W>
.
|
|
Yeah, the next big thing is getting the text spacing/selection/highlighting working properly - I've got improvements so far but not a total solution - but it would be good to fix it for 2018/04/08 - (3.8.0 😀) |
…ault This PR removes support for saving in the binary map file format of Mudlet 2.1 - i.e. format **16** (retaining the ability to read it) and adjusts the format for new map files to be **20** by default - up from the previous default of **18**. This should speed up map loading a little - as it will remove the need to convert the data to the current forms used internally as well as making some details more robust. It also allows the removal of some warning code that would have fired if area or map user data features were used and format *16* was selected for saving. #### History of recent (last six years) changes to Map File Format: * dfce0f0 (PR Mudlet#2106) - **20** Improved way that custom exit line data was held internally (so that the keys are now the same as the other exit details that are keyed by a string {doors, exit weight}. The custom exit line style is stored as the shorter and easier to code with `Qt::PenStyle enum` instead of a English `QString` and the custom exit line as a `QColor` instead of a `QList<int>` with 3 elements - (so the custom exit line could have a alpha component in the future!) Code is in place to support a workaround to work within map formats back to include version 17. * 91a08c3 (PR Mudlet#1543) - **19** Added support for more than one of any grapheme for the 2D map room symbol. Code is in place to support a workaround to work within map formats back to include version 17. * 94dd41b (associated with PR Mudlet#301) - **18** Added support for multiple user rooms in map file copied to other profiles - so that the original player room (in the other profile) is retained in a map copied over. Also revised the `TArea::rooms` from being a `QList` to a faster to look up in `QSet`. Code in place to support saving in previous formats. * fb79c62 (associated with PR Mudlet#280) - **17** Added support for area and map user data features. Warnings are issued should these be actually used and a lower map format is specified to save the map in **as that data will then be lost from the map file**. * 88ef649 - **16** Map format of Mudlet 2.1 dating back to 2013-01-02 . Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
…ault This PR removes support for saving in the binary map file format of Mudlet 2.1 - i.e. format **16** (retaining the ability to read it) and adjusts the format for new map files to be **20** by default - up from the previous default of **18**. This should speed up map loading a little - as it will remove the need to convert the data to the current forms used internally as well as making some details more robust. It also allows the removal of some warning code that would have fired if area or map user data features were used and format *16* was selected for saving. #### History of recent (last six years) changes to Map File Format: * dfce0f0 (PR #2106) - **20** Improved way that custom exit line data was held internally (so that the keys are now the same as the other exit details that are keyed by a string {doors, exit weight}. The custom exit line style is stored as the shorter and easier to code with `Qt::PenStyle enum` instead of a English `QString` and the custom exit line as a `QColor` instead of a `QList<int>` with 3 elements - (so the custom exit line could have a alpha component in the future!) Code is in place to support a workaround to work within map formats back to include version 17. * 91a08c3 (PR #1543) - **19** Added support for more than one of any grapheme for the 2D map room symbol. Code is in place to support a workaround to work within map formats back to include version 17. * 94dd41b (associated with PR #301) - **18** Added support for multiple user rooms in map file copied to other profiles - so that the original player room (in the other profile) is retained in a map copied over. Also revised the `TArea::rooms` from being a `QList` to a faster to look up in `QSet`. Code in place to support saving in previous formats. * fb79c62 (associated with PR #280) - **17** Added support for area and map user data features. Warnings are issued should these be actually used and a lower map format is specified to save the map in **as that data will then be lost from the map file**. * 88ef649 - **16** Map format of Mudlet 2.1 dating back to 2013-01-02 . Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
* Refactor: extract a simple function that is used in several five places Signed-off-by: Stephen Lyons <slysven@virginmedia.com> * Refactor: eliminate shadowed variables in TTextEdit::mouseMoveEvent(...) The use of `x` and `y` in nested code is confusing as the inner ones mask the outer ones. This commit renames the inner copies. It also makes a local reference to a section of the text attribute buffer: `(std::deque<std::deque<TChar>>) TBuffere::buffer) that is used several times. Signed-off-by: Stephen Lyons <slysven@virginmedia.com> * BugFix: cure the faulty selection when crossing an empty line. The use of *manhattenLength()* was incorrect when determining whether it was the start or end of the selection that was nearest to the mouse cursor, instead it now (correctly) only considers the horizontal (x) offset when the vertical offsets of the start and end point of the selection are equal. Signed-off-by: Stephen Lyons <slysven@virginmedia.com> * BugFix: finally cures the selection of text both with and without timestamps Also: * abstract the number of spaces for the timestamp on the left to a constant `(int) TTextEdit::mTimeStampWidth`. * renames `y` and `x` variables in the `TTextEdit::mouseMoveEvent(...)` to `lineIndex` and `tCharIndex` as that more accurately describes them - and also rename another pair of shadowing/masking `y` and `x` variables in the SAME method to `yIndex` and `xIndex` respectively. * convert a few remaining random C-style `(int)` casts in `TTextEdit` class to C++ `static_cast<int>(...)` ones. NOTE: An issue with deselection something in an upward direction against the left margin remains - however the area is being correctly deselected but code elsewhere that analyses which parts of the display actually require repainting is missing that portion of the modified area of text. It appears to be within the `TTextEdit::highlight()` method but it IS a separate issue as the underlying text attribute buffer is being correctly changed to clear the selection flags. Signed-off-by: Stephen Lyons <slysven@virginmedia.com> * Revise: make time stamps show in lower pane as well as upper one It is visually disturbing for the lower pane in the main, error and debug consoles not to match the upper one when it is revealed by scrolling - or by turning on the timestamps for the main console. Signed-off-by: Stephen Lyons <slysven@virginmedia.com> * Revise: reduce space for time stamps from 15 to 13 (12 + space) characters The use of 15 rather than 13 produced the need for an additional tweak when trying to work out where the first actual game text start when trying to deduce the position of it relative to the cursor! Signed-off-by: Stephen Lyons <slysven@virginmedia.com> * Fix insertPopup and echoPopup to accept "main" as an argument (Mudlet#3013) * Update: drop support for saving to Mudlet 2.1 map format & update default This PR removes support for saving in the binary map file format of Mudlet 2.1 - i.e. format **16** (retaining the ability to read it) and adjusts the format for new map files to be **20** by default - up from the previous default of **18**. This should speed up map loading a little - as it will remove the need to convert the data to the current forms used internally as well as making some details more robust. It also allows the removal of some warning code that would have fired if area or map user data features were used and format *16* was selected for saving. #### History of recent (last six years) changes to Map File Format: * dfce0f0 (PR Mudlet#2106) - **20** Improved way that custom exit line data was held internally (so that the keys are now the same as the other exit details that are keyed by a string {doors, exit weight}. The custom exit line style is stored as the shorter and easier to code with `Qt::PenStyle enum` instead of a English `QString` and the custom exit line as a `QColor` instead of a `QList<int>` with 3 elements - (so the custom exit line could have a alpha component in the future!) Code is in place to support a workaround to work within map formats back to include version 17. * 91a08c3 (PR Mudlet#1543) - **19** Added support for more than one of any grapheme for the 2D map room symbol. Code is in place to support a workaround to work within map formats back to include version 17. * 94dd41b (associated with PR Mudlet#301) - **18** Added support for multiple user rooms in map file copied to other profiles - so that the original player room (in the other profile) is retained in a map copied over. Also revised the `TArea::rooms` from being a `QList` to a faster to look up in `QSet`. Code in place to support saving in previous formats. * fb79c62 (associated with PR Mudlet#280) - **17** Added support for area and map user data features. Warnings are issued should these be actually used and a lower map format is specified to save the map in **as that data will then be lost from the map file**. * 88ef649 - **16** Map format of Mudlet 2.1 dating back to 2013-01-02 . Signed-off-by: Stephen Lyons <slysven@virginmedia.com> * BugFix: handle empty SGR...m sequences so they are treated as SGR0m The empty (no parameter) case is the same as the one with a single 0 which is the reset attributes case. Mudlet was not handling it as that but it will do after this commit. This will close issue Mudlet#2993 . Also clean up some tabs used for spaces in the same method: `(void) TBuffer::translateToPlainText(...)` Signed-off-by: Stephen Lyons <slysven@virginmedia.com> * Revise: some commented material in TTextExit::convertMouseXToBufferX Signed-off-by: Stephen Lyons <slysven@virginmedia.com>
…ault This PR removes support for saving in the binary map file format of Mudlet 2.1 - i.e. format **16** (retaining the ability to read it) and adjusts the format for new map files to be **20** by default - up from the previous default of **18**. This should speed up map loading a little - as it will remove the need to convert the data to the current forms used internally as well as making some details more robust. It also allows the removal of some warning code that would have fired if area or map user data features were used and format *16* was selected for saving. #### History of recent (last six years) changes to Map File Format: * dfce0f0 (PR Mudlet#2106) - **20** Improved way that custom exit line data was held internally (so that the keys are now the same as the other exit details that are keyed by a string {doors, exit weight}. The custom exit line style is stored as the shorter and easier to code with `Qt::PenStyle enum` instead of a English `QString` and the custom exit line as a `QColor` instead of a `QList<int>` with 3 elements - (so the custom exit line could have a alpha component in the future!) Code is in place to support a workaround to work within map formats back to include version 17. * 91a08c3 (PR Mudlet#1543) - **19** Added support for more than one of any grapheme for the 2D map room symbol. Code is in place to support a workaround to work within map formats back to include version 17. * 94dd41b (associated with PR Mudlet#301) - **18** Added support for multiple user rooms in map file copied to other profiles - so that the original player room (in the other profile) is retained in a map copied over. Also revised the `TArea::rooms` from being a `QList` to a faster to look up in `QSet`. Code in place to support saving in previous formats. * fb79c62 (associated with PR Mudlet#280) - **17** Added support for area and map user data features. Warnings are issued should these be actually used and a lower map format is specified to save the map in **as that data will then be lost from the map file**. * 88ef649 - **16** Map format of Mudlet 2.1 dating back to 2013-01-02 . Signed-off-by: Stephen Lyons <slysven@virginmedia.com>








Brief overview of PR changes/additions
I have long wanted to use more than just ASCII letters for room symbols - this commit adds support for any glyph to be used and more than one - although there is a trade off in fitting the text into a square or round room symbol which means longer strings have to be smaller to fit. Each different symbol is resized to fit and this allows for the use of symbols with combining diacriticals and those from beyond the BMP.
Controls are added to the profile preference that allows a specific font to be used for room symbols - so a Server/Crowd source map could bundle up one that includes all the symbols needed; and there is also a check-box option to force just that font to be used if that is important. However if a map is shared it is not impossible for the end-using system not to have a particular font or indeed any font with a glyph in.
Therefore there is a secondary dialog available on the "Mapper" tab of the "Profile Preferences" that can be called up and which gives an informative display of what symbols are used where and from what Unicode codepoints they are composed as well as whether the current system can display each symbol in either the specified font or as a fall-back, any font available to a Qt Application - for simplicity a colour coded icon is displayed against each line in the table of symbols indicating whether it can be found in the selected font (
); only in another font (
) or is missing altogether on the system (
). As this responds interactively as the selected font is changed it should enable the user to find a suitable choice for their case.
Motivation for adding to Mudlet
I want to be able to decorate my maps with the fine range of glyphs from George Douros' Public Domain Symbola font.
Other info (issues closed, discussion etc)
The revised data ideally would be stored directly into the Mudlet binary map format and I have incremented the version number to 19 to support this feature - however I have been able to provide a fall-back that silently uses the map and room user data areas and leave maps in the current default 18 format able to be read with the current versions of Mudlet without issue if only the currently supported symbols ("letters") are used - should a Mudlet version with this PR included set a symbol that cannot be displayed in the current versions in existence they will display a
?instead. Similarly, going forward from this PR the luagetRoomCharandsetRoomCharshould be deprecated, however they will still work with the previous range of characters - although both current versions and this code going forward will return a '?' for a room symbol that cannot be encoded as a single byte, additionally this code will include a second error message advising the use of the replacementgetRoomSymbolwhich returns a UTF-8 encoded string. The companionsetRoomSymbolwill also accept an empty string (or a space) to clear a room symbol (as will the revisedsetRoomChar) which seems to have been a previous undocumented software feature i.e. it was not possible to clear a room symbol from a lua script... 😮