Jump to content

W3_Bill

Members
  • Posts

    22
  • Joined

  • Last visited

Previous Fields

  • Languages
    CSS, HTML, Javascript, XHTML

Profile Information

  • Location
    Colorado
  • Interests
    atmospheric science;
    China and Chinese culture and language;
    classical music;
    color;
    pipe organ.

W3_Bill's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. > XHTML is actually an old and outdated standard, I would not suggest sticking with it. That's news to me! But I'm not surprised. Can't use greater than or less than symbols? That makes for harder-to-read code. I also repeatedly find character entity names (like &nbsp) rejected; I have to use their numbers. That is specific to xhtml, right? It certainly makes the code harder to read, understand, and maintain. So I'm taking your suggestion and going back to html. Suggestion to W3Schools: The xhtml tutorial page should say what Ingolme said, and recommend to programmers that have the choice to forget xhtml and use the current version of html. Thank-you, Ingolme. I consider this thread closed.
  2. My objective is the opposite. I'm putting in a lot of effort to make all my documents much more strictly compliant with standards. I want my docs to be xhtml docs. I've invested a lot of time and effort in the W3Schools site (and other places) learning xhtml, figuring out how to convert my docs, and trying to figure out what's wrong with debug.xhtml. What do I need to do to make debug.xhtml valid xhtml?
  3. Results of all the above... When mixing languages within sentences, "span" is needed. the "lang=___" is needed within the spans. font terminology is somewhat confusing, as is the hierarchal organization of fonts. (not W3Schools' problem or fault) part of my problem was my Firefix "about:config" settings. they were overriding html/css font settings. the generic font for kaiti fonts is "cursive" (without the quotes). The font-family is "kaiti" (should be in quotes). Two long-term suggestions: a W3Schools page teaching best practices for mixing languages within sentences/paragraphs, etc. in (x)html web pages. a page showing the hierarchal organization of fonts would be a big help. the page should include generic font names and font-family names. I saw somewhere that there are thousands of fonts, so I understand such a page would take a lot of time and effort. Firefox bug 1523688 was a false alarm and is closed. I consider this thread closed. Thank-you, Ingolme, for your help.
  4. My javascript is within a 39-line xhtml file "debug.xhtml", which is attached. When I load the file into Firefox 65 on a Fedora-28 workstation, I get the following error message: XML Parsing Error: not well-formed Location: file:///[private path]/debug.xhtml Line Number 29, Column 21: if (picturenum < 10) { --------------------^ W3C's validator gives the following message: Line 27, Column 20: character "<" is the first character of a delimiter but occurred as data if (picturenum < 10) { I've wrestled with this for hours. What's wrong? If it helps, the validator also gives 5 additional messages: (1) Line 6, Column 18: there is no attribute "charset" <meta charset="UTF-8" /> (2) Line 6, Column 27: required attribute "content" not specified <meta charset="UTF-8" /> (3) Line 14, Column 39: document type does not allow element "img" here; missing one of "ins", "del", "h1", "h2", "h3", "h4", "h5", "h6", "p", "div", "address", "fieldset" start-tag <img id="BianzhongPic" src="x" alt="" > (4) Line 14, Column 40: end tag for "img" omitted, but OMITTAG NO was specified <img id="BianzhongPic" src="x" alt="" > (5) Line 14, Column 1: start tag was here <img id="BianzhongPic" src="x" alt="" > These all look like false alarms to me. Thank-you in advance. Bill. debug.xhtml
  5. I have submitted bug # 1523688 against Firefox to address this issue.
  6. There is a hierarchical organization of fonts, but hardly anyone calls it a "taxonomy". I am not aware of a formal accepted term for that hierarchical organization. I chose the term "taxonomy" because readers would understand what I meant, though it might not be the accepted term. The "generic family" list you gave in your first reply is probably the first, highest level breakdown of the hierarchy. "Times", "Courier", "Deja Vu Sans", "Deja Vu Serif", "Free Mono", etc. are likely in the next level. My searching took me to the W3C site, and this web page: "https://www.w3.org/TR/css-fonts-4/". Your first reply was correct in saying that "cursive" is the correct "generic family" for kaiti fonts. Since my last post, I've realized that in my "playing around", I've been putting "generic family" values in quotes. Those values are "keywords", and must not be in quotes. (I found that out in the that same W3C web page.) So I did yet more "playing" today. Unfortunately, it still doesn't work. I'm now thinking the problem is likely to be in Firefox. I've posted a question there. From that, I'll see if a bug needs to be filed against Firefox. I'll post something here if/when I get something useful from Mozilla.
  7. After previously playing around with "lang" quite a bit, I had the feeling that "<span>" would end up being the answer. My newest round of "playing" with this shows me that "<span>" is the only thing that works. It think it was you (Ingolme) that introduced me to "<span>" in some previous thread. Now back to "font-family".... In biology, one way living things are organized is by "taxonomy". A common taxonomy of living things goes like this: "life - domain - kingdom - phylum - class - order - family - genus - species". When I look at the W3CSchools page on font-family, my impression is that there is a "taxonomy" for fonts. So "Times New Roman" is a detailed-level name (like genus or species), "Times" is an intermediate-level name, and "serif" is a high-level name (like domain or kingdom). It seems the list you gave earlier ("generic fonts are serif, sans-serif, monospace, cursive, fantasy and system-ui") is high-level (like domain or kingdom). I understand that "AR PL UKai CN" is a detailed-level name (like genus or species), and probably won't work on most non-Linux systems (and even some Linux systems). What is the "taxonomy" for "AR PL Ukai CN"? ...or what is the taxonomy of Chinese fonts? I've tried many things, none have worked. I've searched, no luck. I'm surprised at how difficult this has turned out to be.
  8. Having read your posting, I went to the W3Schools site and studied the "lang" feature, and dug in more to UTF-8, and related topics. I played around some with "lang". Take a look at the attached screen-capture. It shows an x-term in which I used the Linux "cat" command to display a file with mixed Chinese and English. Notice that the English and Chinese are mixed within a single sentence as well as within a single paragraph. My apologies that when I launched this thread, I did not realize that it would be relevant that the Chinese and English are mixed within a paragraph, and even within a single sentence. My playing around shows that it does matter. My hope was that for the whole web page, I could specify one font family for all English text on the page, and a separate font family for all the Chinese text on the page, and the browser's rendering engine would know from the (UTF-8?) character codes which font family to use without me telling it what text is Chinese and what text is English. Is there any way of handling this other than using "span"? I also played around with the font-family itself. I tried each of "regular script", "kaiti", "kaishu", "zhengshu", "zhengkai", and cursive, all also with spaces and dashes as well as one word. I also tried "serif", "sans-serif", and "monospace" as well as "cursive". The only way I can get a kai-like font is to use "ar pl ukai cn". I checked my workstation's font tool to look for family or generic names. No luck. I also tried looking in the W3Schools references. If an answer is there, I missed it. Any ideas?
  9. Ingolme, I think a key part of the question was missed. A web page has both English text and Chinese text. How do I specify one font family for the English text, and a different font family for the Chinese text, using at most two font-family specifications, each applicable to the whole page?
  10. I have a few web pages that contain a mix of Chinese and English text. I know from the W3Schools CSS "Fonts" page how to specify the default font for a web page containing English text only, so that I get Times (serif) regardless of the browser and operating system. But how do I also set the default font for Chinese text so that I get, in all browsers and on all operating systems, something looking very closely like what my home workstation (a Fedora system) calls "AR PL UKai CN"? I see in wikipedia that what on my Fedora system is "AR PL UKai CN" can be called "kaiti", "kaishu", "zhengshu", "regular script", "zhengkai", and possibly other names. What are the correct "font family" and "generic family" names for "AR PL UKai CN" to use in the CSS "font-family" property? What I'm looking for is like the middle column in the attached png image, which came from "https://en.wikipedia.org/wiki/List_of_CJK_fonts". Thank-you in advance for your help. Bill.
  11. Thank-you for your response. Well, I can't explain it, but now it works as desired. I didn't do anything but reboot and try it on different days! Don't you just love it when problems mysteriously fix themselves or disappear?! Bill.
  12. 1. I have some HTML in which I've embedded some JavaScript. In Firefox-62, it works on a Fedora-27 workstation as I want, but on a windows-7 box, the browser seems to act as if the script does not exist. Here is an HTML extract showing the embedded JavaScript: <table> <tr> <td style="padding: 0;"> <img id="BianqingPic" src="x" alt=""/> </td> </tr> </table> <p id="BianqingCaption" class="photocaption"> </p> <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <script type="text/javascript"> "use strict"; var newPic = "BianQing_"; var d = new Date(); //-------------------------------------------------------------------------- // picture choice is based on deci-hours (1 deci-hour = 6 minutes). // all_minutes = (60 * hours) + minutes; range is 0 to 1439. // (day-of-month - 1) is then added to throw this "out of sync" with the // ErHu picture choice; range is 0 to 1469. // deci-hours = all_minutes / 6; range is 0 to 244. //-------------------------------------------------------------------------- var all_minutes = (d.getMinutes() + (60 * d.getHours())) + (d.getDate() - 1); var picnum = (Math.floor ( all_minutes / 6 ) % 7) + 1; document.getElementById ( "BianqingCaption" ).innerHTML = "Biān Qìng" + "&nbsp&nbsp(picture #" + picnum + " of 7; " + "based on deci-hours)"; newPic = newPic + picnum + ".jpg"; document.getElementById("BianqingPic").src = newPic; </script> I tried adding "console.log" statements just after the "use strict;" line, and between the last two lines of the script body. Absolutely nothing shows up in the web console or the browser console. Why is the script (apparently) being ignored? The windows-7 and the Fedora-27 systems were updated last week, as was Firefox. By the way, the w3schools page "https://www.w3schools.com/js/js_debugging.asp" is out of date. Firefox no longer uses Firebug, and the web site pointed to by the link provided for getting Firebug no longer exists. Thank-you in advance for your help. Bill.
  13. Wow! That worked! That was easy! Thank-you. This question is "solved". Bill.
  14. Background: In C++, I can put a group of definitions into a separate file, and then in the C++ source, do a "#include <include_file_path>" to bring those definitions into the C++ file at the desired location. An example would be putting basic physics constants (gravitational constant, electron charge, dry gas constant, electron mass, speed of light in a vacuum, Plank's constant, etc.) into a file "physics_constants.H", and then a physics application program would have a line #include "physics_constants.H" In a JavaScript, I have an array of photo captions (text). Here's a piece: var captions = [ "Longs Peak on March 17, 2016" + "<br />" + "Colorado, USA" , "Mt. McKinley on January 19, 2015" + "<br />" + "Alaska, USA" , [etc.] "Medicine Bow Peak on February 14, 2000" + <br/>" + "Wyoming, USA" ]; The array actually has 58 entries. Rather than embedding that into the JavaScript (which is in turn a part of an html file), I'd like the array definition to be in a separate file by itself, and then put a JavaScript equivalent of the C++ "#include <include_file_path>" at the appropriate place in the JavaScript. Questions: Does JavaScript have such a capability? If yes, how do I do it? Thank-you for your help. Bill.
  15. Wow. You're fast. Thank-you. I haven't seen a way of tagging a question "solved" (like the Fedora users forum does), but I consider this "solved". Bill.
×
×
  • Create New...