I am new to CSS and web development in general. Hopefully there is a way to accomplish what I am trying to do. What I am trying to do is simple to explain, but I need to give some background info first, sorry for the length of the post.
I have created a webpage that is in the Tibetan language. Tibetan does not have spaces between words, it only has a character called a "tsheg" (་ - U+0F0B) that is used to separate every syllable. It also has a mark called a "shey" (། - U+0F0D) that comes at the end of phrases and clauses and sentences. Although sometimes it is doubled, after a shey is generally a space before the next line of text. When typing in Tibetan this space is represented not as a normal space (U+0020) but instead U+00A0, however when it comes to browsers and HTML/coding in general these two seem to behave the same.
In any Tibetan writing, the ideal aesthetic is for full justification. Traditionally there would be slight spaces placed between the tsheg marks and the shey marks to achieve a perfectly flush left and right alignment. (The exception would be the last line of a text, or a paragraph in contemporary formatting, does not need to be justified). It is acceptable for lines to break mid-word or mid-sentence, but never mid syllable. So the last character on any line is going to be either a tsheg or a shey. It is also not acceptable to start a line with a shey. In the last few years this has been easy to achieve for desktop publishing using MS Word, using "Thai Justification." However that option is not available even in other Office products, never mind outside of the Office environment. Other work-arounds have been to add invisible width characters after every tsheg and shey, allowing for wrapping at any point.
Now comes the question and difficulty. I am using distributed justification, and that seems to be the best option. It does not break syllables up, which is important. But it only wants to break at those spaces after shey marks, and it breaks elsewhere when there is a long string of text without a space, but if there is a space then it breaks there, sometimes stretch one or two syllables across an entire line, which is obviously not ideal.
Now, when coding the HTML of the text I can use the same work-around that is used for desktop publishing pre "Thai justification," I can add a <wbr> after every single tsheg, and this will not be visible to the end user and should allow cleaner breaking. However, there are two problems with this. But inserting that many <wbr> characters I am essentially doubling, or close to doubling, my character count, which can make the page take twice as long to load, even if half of those characters are invisible. However, more important is that it disrupts search functionality. Although you may see the word that has the syllables "AB" for instance, if you tried searching for AB you wouldn't find it, because the HTML sees "AB". And being able to search is kind of critical. Enough so that an ugly formatting is preferable to losing the ability to search and to be indexed properly. Obviously, since I need the site to be responsive and I do not know what size screens will be used I cannot have forced line breaks, either, another trick used when publishing.
So, finally, my question. Is there a way I can define a style or function or some sort of element that automatically associates a certain character--in my case the tsheg character--as having a <wbr> command after it without actually needing to input that command into my HTML? So when the text is justified it treats every tsheg as a <wbr>? I have a class .Tibetan in my stylesheet that defines the font and the justification and so forth, is there some way I can add some code there that achieves what I am looking for?
The one other thing I tried was replacing all of the spaces with which gave a beautiful justified appearance but it also caused the browser to disregard the tsheg marks entirely and it allowed for the cutting in half of syllables.
If you want to see an example of what I am talking about you can visit this page of my site: http://publishing.simplebuddhistmonk.net/index.php/downloads/critical-editions/ and next to the word "English" click the Tibetan characters and that will bring up a paragraph of prose, or you can look here: http://publishing.simplebuddhistmonk.net/index.php/downloads/tibetan/essence-of-dispelling-errors-tib/ (though the formatting on that latter page is less egregious than the former, at least on my screen).
EDIT It looks like the solution this person used might be able to be adapted for my use: Dynamically add <wbr> tag before punctuation however I do not actually understand what I would need to add, and where, to make that work for me. Anyone think that might apply to this scenario? And if so, what code would I add where?
NEW EDIT So, I think the problem might be with the search function that comes from my WordPRess theme. I used my workaround as mentioned above, adding the tag after every tsheg, on this page: http://publishing.simplebuddhistmonk.net/index.php/downloads/tibetan/essence-of-dispelling-errors-tib/ and as you can see, it displays perfectly. But if you search for any phrase from that page using the search function that is up in my header, it will not find it. If you do a Ctrl+F and search on the page, though it will find it. Even if you copy the text from the page and paste it into the search box it still does not find it. Copy the text into a word editor doesn't reveal any hidden or invisible characters. However, if you search for a term from this page http://publishing.simplebuddhistmonk.net/index.php/downloads/tibetan/beautiful-garland-ten-innermost-jewels-tib/ which I have not added the tags to, you will see that it finds it no problem.
So, that leads me to believe the error is in the search function. Any experience with this? Because search is important but I can quite possibly find alternative earch widgets to replace the one that comes with the theme. What is most important though is if you search for a line of text on Google it needs to be found. My site has not been indexed fully by any search engine so I cannot yet confirm if this does or does not affect them.
So.... At this point I wil take any advice I can get. Any advice regarding the original question (is there a way to tell the style guide "if your are displaying X then treat it like X" ) or any idea about this issue with the search functionality, and how the tag may or may not affect search, both from within the site and also from search engines.
Related
I am having trouble finding an answer to this. I am trying hard to make sure our site is inclusive so I initially implemented a site-wide letter spacing value of .12rem. However, some managers don't like how it looks and have asked me to reduce or remove it. I told them about ADA compliance so now we have an internal discussion going on about what to do.
Should I not set letter-spacing to a specific value so that each user can handle that on their own if they have a vision disability?
Are there tools available for users to adjust the letter (and word) spacing on a page?
If so, would setting it to a specific value actually make it worse for those tools?
Also, what about word-spacing? Should it be handled in the same way?
If you have any other insight to offer on this topic I would love to hear it. I've been searching online for a while and I am having trouble finding a definitive answer.
Source: https://www.w3.org/WAI/WCAG21/Understanding/text-spacing.html
The Web Content Accessibility Guidelines (WCAG), which is an international standard, does not specify anything about letter spacing or word spacing.
However, it does say that if the user changes their letter spacing (and other spacing requirements) via custom CSS then your page should still render correctly (up to a point). See guideline 1.4.12 Text Spacing
That's probably where you're getting your .12rem from because 1.4.12 says:
"Letter spacing (tracking) to at least 0.12 times the font size;"
The guideline doesn't say that you must use this letter spacing. It says that if the user sets their letter spacing to 0.12 (or less), then the page must still display properly. If the user sets it to 0.13 (or more), then technically it doesn't matter if your page doesn't reflow nicely.
Is there a way to add a hidden info-text in FontForge? I think, I could need that sometimes.
I mean something like that:
Hint 1: I generate that text with a external graphic programm, not with FontForge itself; because that's my question how to do that.
Hint 2: The info text should be for own work, not for read out etc.
Hint 3: I mean info-text in the displayed area, not the comment function under 'glyph info'.
As a FontForge developer, I guess the best way is to make a point with a really long name. A single floating point shouldn't mess anything up, especially if it's inside the bounds of the left and right bearings of the glyph.
So, go to «Point→Name Point». If you want multiline input, copy and paste from e.g. Notepad++.
I noticed that it seems to render multiple lines in the wrong place, which seems to be a minor bug (I'll open a bug for it done: №4420), but you can just move the point up, or use multiple points floating at the right side for multiple lines.
I've written a program that uses the Google Translate Python API to translate webpages. Most of the time, the API does translation as I expect, but in some cases text within a tag does not get translated.
I tried putting one such tag in the Google Translate web interface and found that the text is still not translated; i.e., the problem has to do with the Google Translate service rather than the way I am using the API.
The specific tag I am looking at is: <div class="someClass">World:</div>
I want the word "World" to be translated in the output, regardless of the language into which I am translating. In certain languages, such as French and Khmer, the word "World" is translated as expected, but in other languages, such as Spanish and Somali, it remains "World." I have noticed that removing the class attribute sometimes helps (translation then works in Spanish but not in Somali), and adding more text seems to help as well (I've never seen this issue when the text is a full sentence or paragraph, for example).
In the context of my project, it is particularly important that the case of a tag with just one word inside be handled correctly. Does anyone know why this is happening or how I can make translation happen consistently? A solution requiring minimal to no changes to the original HTML would be ideal.
Edit A little more context based on playing around with things: Directly calling google.cloud.translate.Client().translate('<div class="someClass">World:</div>', 'es') actually has the correct behavior: "World" becomes "Mundo." I incrementally lengthened the page text by adding tags that came before and after that div in the original webpage--none of which wrapped more than one word of text--and the text between tags stopped being translated when the text was around 1,000 characters long. However, when I changed "World:" to a whole sentence, all of the text between tags was translated even when the page text was longer than 1,000 characters.
how can I CORRECTLY display English and non-English (Persian, Farsi language, middle eastern) words in ASP.NET labels or text boxes? it is OK when I type or display only English or only non-English (Farsi) words, but when I type or display a sentence which contains both of them, everything gets out of order, my sentences are misplaced, punctuation symbols are wrongly inserted, in another word it is difficult to understand what is written.
When I'm going to use Office Word for writing Persian documents (which may contain English words), first I set paragraph direction as Right-To-Left, is it possible to do something similar in ASP.NET? of course I set following style in my ASPX files and now my texts boxes start writing from right to left but it does nothing for solving the aforementioned problem!
Style="text-align: right"
how can I solve it? thanks
You need to use the correct value for the dir attribute - in this case, rtl:
dir="rtl"
This needs to be done in the containing element.
There are also CSS properties you can set, as discussed in this document (thanks #ANeves).
Recently I've seen a wide usage of dotted and dashed hyperlinks in a variety of Russian Web 2.0 websites. Normally such links (which have a dashed or dotted line underneath them, instead of a normal solid line) don't lead a user to another page, but rather perform an action on the same page without reloading it.
As an example, such links can fold/unfold information blocks, or switch between sorting order of page elements.
So I'm wondering: are such links used in the same way in the bigger internet?
Also, are there any articles or books which describe standard look&feel for hyperlinks depending on the action they perform?
There was a time, way back in the day, when a few folks tried to stick with the idea that dashed underlines were for contextual help. I think that was a carry over from old Windows help files.
But, since then, no, there is no rule or standards as to what the style of underline means in a hyperlink. For better or worse, the underline, itself, isn't even a standard anymore as lots of sites forgo them (which, IMHO, is more often than not a bad idea).
All that said, I do like the idea and the attempt and differentiating on-page interaction vs. a link that actually takes you somewhere else.
I think it's just a matter of style and taste.
Personally, I wouldn't do it. Traditionally, hyperlinks are blue and underlined (or get underlined on mouseover). It helps the users navigate swiftly through the page without thinking much. If you have your links green and overlined, it works just as well but in my opinion, it's less user-friendly (for a new visitor).
Unless it has a special meaning on your site, of course.
The dotted underline is -as far as i know- traditionally used for the acronym tag.
The normal format for hyperlinks is 'http://web.site.com/path/to/my/content?arg=value&arg2=value2#hashtag'. For relative links, parts of the URL are optional.
Technically, dots and dashes are acceptable in almost every part of a URL. It is unusual to see dots in the path, but dashes are quite normal (see the URL for this page, for instance). Dots and dashes are both uncommon in query parameters (the arg=value part), but should work. It is very common to see both dots and dashes in the hashtag, which is what I believe you were referring to.
The purpose of the hashtag is traditionally to link to a location within a web page, marked by an anchor tag () with a name attribute. In modern webapps, the hashtag is used as a 'bookmark' for a particular view in the app -- in GMail, for instance, the hashtag is used to mark which label and message you are viewing. There is no established norm for what is an appropriate hashtag. You should use whatever makes sense for your app. A human-readable tag is usually preferable, as it gives the user a better understanding of what the URL means, but it is certainly not required.
Find the following in the CSS of the page -
border-bottom: 1px dashed #05C;
It's just a style override for the default underlining.