Skip to content

Commit cd040ae

Browse files
committed
fix zalgo properly! remove ugly regexp hacks for detecting combining diacritics and instead set the right font ordering, as Arial combines nicely with Myriad Pro whilst Helvetica doesn't. (Myriad Pro itself has no combining diacritic characters)
1 parent 9a64dc2 commit cd040ae

File tree

10 files changed

+16
-25
lines changed

10 files changed

+16
-25
lines changed

src/skins/vector/css/common.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ html {
2222
}
2323

2424
body {
25-
font-family: 'Myriad Pro', Helvetica, Arial, Sans-Serif;
25+
/* Myriad Pro lacks combining diacritics, so these will fall through
26+
to the next font. Helevetica's diacritics however do not combine
27+
nicely with Myriad Pro (on OSX, at least) and result in a huge
28+
horizontal mess. Arial empirically gets it right, hence prioritising
29+
Arial here. */
30+
font-family: 'Myriad Pro', Arial, Helvetica, Sans-Serif;
2631
font-size: 16px;
2732
color: #454545;
2833
border: 0px;

src/skins/vector/css/molecules/EventAsTextTile.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ limitations under the License.
1616

1717
.mx_EventAsTextTile {
1818
opacity: 0.5;
19+
overflow-y: hidden;
1920
}

src/skins/vector/css/molecules/EventTile.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ limitations under the License.
4545
font-size: 14px;
4646
margin-bottom: 4px;
4747
display: block;
48+
overflow-y: hidden;
4849
}
4950

5051
.mx_EventTile .mx_MessageTimestamp {
@@ -64,6 +65,7 @@ limitations under the License.
6465
.mx_MessageTile_content {
6566
display: block;
6667
margin-right: 100px;
68+
overflow-y: hidden;
6769
}
6870

6971
/* Various markdown overrides */

src/skins/vector/css/molecules/MemberInfo.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ limitations under the License.
3737
}
3838

3939
.mx_MemberInfo_profileField {
40-
opacity: 0.6;
40+
font-color: #999999;
4141
font-size: 14px;
42+
position: relative;
43+
background-color: #fff;
4244
}
4345

4446
.mx_MemberInfo_buttons {

src/skins/vector/css/molecules/MemberTile.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,6 @@ limitations under the License.
9898
opacity: 0.25;
9999
}
100100

101-
.mx_MemberTile_zalgo {
102-
font-family: Helvetica, Arial, Sans-Serif;
103-
}
104-
105101
.mx_MemberTile:hover .mx_MessageTimestamp {
106102
display: block;
107103
}

src/skins/vector/css/molecules/MessageComposer.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ limitations under the License.
5959
box-shadow: none;
6060

6161
/* needed for FF */
62-
font-family: 'Myriad Pro', Helvetica, Arial, Sans-Serif;
62+
font-family: 'Myriad Pro', Arial, Helvetica, Sans-Serif;
6363
}
6464

6565
/* hack for FF as vertical alignment of custom placeholder text is broken */

src/skins/vector/css/molecules/RoomHeader.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ limitations under the License.
111111

112112
.mx_RoomHeader_nametext {
113113
display: inline-block;
114+
overflow-y: hidden;
114115
}
115116

116117
.mx_RoomHeader_settingsButton {

src/skins/vector/css/molecules/SenderProfile.css

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,3 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
16-
17-
.mx_SenderProfile_zalgo {
18-
font-family: Helvetica, Arial, Sans-Serif;
19-
display: table-row ! important;
20-
}

src/skins/vector/css/organisms/MemberList.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ limitations under the License.
4545
}
4646

4747
.mx_MemberList_invite {
48-
font-family: 'Myriad Pro', Helvetica, Arial, Sans-Serif;
48+
font-family: 'Myriad Pro', Arial, Helvetica, Sans-Serif;
4949
border-radius: 3px;
5050
border: 1px solid #f0f0f0;
5151
padding: 9px;

src/skins/vector/views/molecules/SenderProfile.js

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ limitations under the License.
1717
'use strict';
1818

1919
var React = require('react');
20-
var classNames = require("classnames");
21-
22-
// The Lato WOFF doesn't include sensible combining diacritics, so Chrome chokes on rendering them.
23-
// Revert to Arial when this happens, which on OSX works at least.
24-
var zalgo = /[\u0300-\u036f\u1ab0-\u1aff\u1dc0-\u1dff\u20d0-\u20ff\ufe20-\ufe2f]/;
2520

2621
module.exports = React.createClass({
2722
displayName: 'SenderProfile',
@@ -30,18 +25,12 @@ module.exports = React.createClass({
3025
var mxEvent = this.props.mxEvent;
3126
var name = mxEvent.sender ? mxEvent.sender.name : mxEvent.getSender();
3227

33-
var classes = classNames({
34-
mx_SenderProfile: true,
35-
// taken from https://en.wikipedia.org/wiki/Combining_character
36-
mx_SenderProfile_zalgo: zalgo.test(name),
37-
});
38-
3928
var msgtype = mxEvent.getContent().msgtype;
4029
if (msgtype && msgtype == 'm.emote') {
4130
name = ''; // emote message must include the name so don't duplicate it
4231
}
4332
return (
44-
<span className={classes}>
33+
<span className="mx_SenderProfile">
4534
{name} { this.props.aux }
4635
</span>
4736
);

0 commit comments

Comments
 (0)