Jump to content

Mark-

Members
  • Posts

    13
  • Joined

  • Last visited

Mark-'s Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Hello, To wrap up, the jCanvas author released a new version today and corrected the font sizing issue. Using the point syntax , e.g. 12pt, the text sizes are correct. Regards, Mark
  2. Hi, Thanks for the response. >Why not just... I tried that and the fonts were the same size regardless of points or pixels. The author of jCanvas posted today that was a bug and it would be corrected very soon. Mark
  3. Hi, Thanks for the response. >Using 1.33 might... I did not determine that from only my screen. I found several tables on the web for conversion. Regards, Mark
  4. Hello, Well, there seems to be no fixed conversion value. After much reading and measuring, it appears a Windows font size multiplied by 1.33 gives the best result. Regards, Mark
  5. Hi, We have a Windows program that lets the user create graphics, rectangles, circles, text etc.. The user sets the text size for the font. For example, a 12pt Tahoma font is the same size in all other programs run on Windows. We take the drawing and convert to Javascript so it can be viewed in a browser, a new feature for us. All the shapes are the correct size. The text is not. I have searched and searched for a solution to the text size on Windows and the text size in the browser, how to make them match. I cannot be the first to run into this issue and I assume it is something simple I am missing. I am using jCanvas to draw the shapes and it wants the font size in pixels which is not the same as a Windows font size. Ideas? Thanks, Mark
  6. Hello, Yes. The user draws whatever and sets up animations based on device inputs (switches, pressure transducers, etc.). Sometimes the user wants a slider to change the opening of a valve, for example. The valve is drawn on the canvas and the slider needs to be next to it. I was using the JQuery UI slider. I tried the HTML slider and might go back to using it now that I should be able to position it on the canvas. I think I will try that tomorrow. Javascript/CSS/HTML is not my normal environment. Thanks for the reply, Mark
  7. Just to close out the thread. This can be added to the head wrapped in a style or to a CSS. #slider { position: fixed; top: 275px; left: 120px; width: 200px; text-align: left;}
  8. Hello, I am a noob when it comes to these languages/frameworks/widgets, but I am getting better. I have created two rectangles on the canvas and all is good. Now, I need to put a horizontal slider, the user selects a value, between the two rectangles. I get the slider on the page but it is below the canvas. I 'assume' this can be done and I am missing a part. Maybe a CSS needs to be created. What am I missing/doing wrong? Thanks for your time, Mark
  9. IE 11. The debugger stopped on a line that was not near the error.
  10. Hello, I am not sure what you are asking. Yes, I am using the debugger in the browser. I am using IE and the indentation did not change with the error. An extra space was added between return and = but, that is hard to detect. I did not check the code in another browser. Mark
  11. Hello, davej, I added the onerror code, thanks. Today I ran into this, I had this code and it was working fine. function IntToColorString(aColor) { return '#' + ('000000' + aColor.toString(16)).substr(-6); } Then sometime last night when I was messing about, I somehow hit the wrong key and added a = to the code. return = '#' + ('000000' + aColor.toString(16)).substr(-6); When I next opened the page I got an error pointing in the totally wrong location. It took me many minutes to find the error. As the code grows larger, this kind of error could be costly. Most other environments I use would have flagged that error at compile time. I just tested with the window.onerror handler and it did not find the error. I had looked at JLint earlier but when I tested it it gave me tons of errors about formatting and I am using the auto format in Aptana so, I have not been using it. I just tested it and JLint caught the error when I pasted just that function. Testing the whole page gave tons of spaces errors. Can anyone recommend a solution? By the by, paste in this editor does not work in IE11. I had to uses Firefox. Thanks for all the help, Mark
  12. Ingolme, That is what happens when I program in languages that are case insensitive and move to ones that are case sensitive. >JavaScript is case sensitive, event names are all in lowercase. That is one I will remember. Thanks for your help. Mark
  13. Hello, I am not new to programming but, I am new to JavaScript. I have searched the web and looked at countless examples and I have not found a solution. The trouble I am having is with a callback not being called. This code works, all good. function RepeatingRequestTask() { xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) alert('done'); } xmlhttp.open("GET", "pageUpdate.xml?page=" + location.pathname, true); xmlhttp.responseType = "arraybuffer"; xmlhttp.send(); setTimeout(RepeatingRequestTask, 2000);} I wanted to move the callback outside the function so I wrote: function UpdateCallBackCompleter() { if ((xmlhttp.readyState == 4) && (xmlhttp.status == 200)) alert('done');} I removed the existing onreadstateChange code and added: xmlhttp.onreadstateChange = UpdateCallBackCompleter; That did not work so I changed it to: xmlhttp.onreadstateChange = function() {UpdateCallBackCompleter();}; And that did not work so the hunt for a solution began. I have found many examples that either should work so I am stumped. Maybe something is wrong the the callback function declaration but I have not seen anything that suggest it. Any ideas? Must be something simple. The debugger was no help. Cheers, Mark
×
×
  • Create New...