Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify and correct usage of breakable whitespace characters #1094

Merged
merged 9 commits into from
Nov 20, 2023

Conversation

SnorlaxMonster
Copy link
Contributor

@SnorlaxMonster SnorlaxMonster commented Nov 6, 2023

In charmap.asm, $1f (¯) is described as a "soft linebreak", while $25 (%) is described as "soft linebreak in landmark names". I don't think these are particularly good descriptions of what these codepoints represent.

Firstly, it is $1f that is used in landmark names, not $25 ($25 appears to be entirely unused).

As for what these codepoints actually do: When displayed on the Town Map, they render as line breaks. Everywhere else, the two render differently: $1f renders a space, whereas $25 renders nothing. In light of this, I think a more accurate description is that $1f is a breakable space (as opposed to the standard space character $7f, which is effectively an unbreakable space) and $25 is a zero-width space.

Also, I question the choice of symbols used to represent these two characters. I don't think a macron or percent sign intuitively represents an optional line break, especially given how rarely these two codepoints are actually used. I think just angle-bracketed terms (e.g. <BSP> for $1f and <ZWSP> for $25) like almost every other control character would be clearer.

Other than landmark names, macrons are used within Japanese strings in comments and untranslated mobile data. Both of these usages appear to be in error. In untranslated mobile data, they are used in various strings, but these usages actually should be <WO> (the Japanese control character at $25) instead of the English control character at this code point.

Macrons are used in comments in moves/grammar.asm, in reference to move usage dialogue (particularly Japanese dialogue). However, in the Japanese version these appear to actually be "hard" linebreaks ($22) or "を " instead. (It's possible the latter are <WO> internally, but in this instance I don't think the internal representation is as important as the display, since they are used purely in comments.) Notably, in the Japanese version these strings use 2-tile linebreaks (<LINE>), whereas the two breakable whitespace characters become 1-tile linebreaks (<LF>) on the Town Map in the English version.

In light of these issues, I have made the following changes:

  • Clarified the comments for $1f and $25 in charmap.asm
  • Renamed $1f and $25 to <BSP> and <ZWSP>, instead of ¯ and %, respectively
  • Updated all usages of $1f and $25 to use the new names
  • Corrected untranslated Japanese strings to use <WO> instead of ¯ for code point $1f
  • Corrected Japanese strings in comments in grammar.asm to align with what is actually displayed in the Japanese version

Comments that quote what the equivalent Japanese text is when using
certain moves were incorrect. I have adjusted these comments to quote
the correct text, based on Japanese Pokémon Crystal.
Use the Japanese control character for $1f instead of the English
control character in untranslated Japanese strings in mobile data.
Replace the two breakable whitespace characters ($1f and $25)
with meaningful angle-bracketed names, instead of using arbitrary
symbols.
charmap.asm Outdated Show resolved Hide resolved
charmap.asm Outdated Show resolved Hide resolved
charmap.asm Outdated Show resolved Hide resolved
Copy link
Member

@Rangi42 Rangi42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly good! I'd rename ZWSP to WBR. Also macros/legacy.asm needs to support the previous Unicode charmaps.

Rename <ZWSP> to <WBR> to match HTML element name
Simplify comments explaining breakable whitespace characters

Co-authored-by: Rangi <[email protected]>
@SnorlaxMonster
Copy link
Contributor Author

I've applied those suggested changes, updated the other locations that reference <ZWSP> to reference <WBR> instead, and added % and ¯ to macros/legacy.asm

home/text.asm Outdated Show resolved Hide resolved
@Rangi42
Copy link
Member

Rangi42 commented Nov 19, 2023

Thanks again! Just merge master to this, because charmap.asm was moved to constants/charmap.asm.

@SnorlaxMonster
Copy link
Contributor Author

I've merged master into my feature branch, so there are no longer conflicts.

@Rangi42 Rangi42 merged commit a82dfd8 into pret:master Nov 20, 2023
1 check passed
fp555 pushed a commit to fp555/pokecrystal that referenced this pull request Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants