Showing posts with label problem. Show all posts
Showing posts with label problem. Show all posts
on Tuesday, 25 March 2014
This bug in Chrome ( i'm using Chromium as it's more stable on Ubuntu, however this bug has also been seen by me personally on OSX running Chrome ) has been plaguing me lately. It has to do with the font not rendering. What I've found so far is that it only seems to happen whenever the font, or more specifically in my case; Google font, is being loaded under the header response "304 Not modified". Whenever the fonts get loaded under "200 Ok" everything goes fine. Now, I've got no material so far to back this up, but I'm not the only one having this problem.

The appearent fix was that you could refresh using the URL, by clicking in the urlbar and pressing enter the page would load this fine or hovering over the element that contained the unrendered text to trigger a render.

After a bit of searching i found the following snippet ( that i modified to work, and absolutely work in my situation as the snippet I found wasn't working in my case but i guess i'm just saying it wasn't me coming up with this brilliant solution. ) as whenever you would resize the window the font also seemed to be triggered to render correctly, that was one of the methods I was using often in the last couple of days to get my text to render.

// Chrome fix for repainting text
$('body').css('padding-left', '1px').promise().done(function() {
     setTimeout(function() {
          $('body').css('padding-left', '0px');
     }, 10);
});

I need to mention that the snippet above is wrapped in document.ready(). It's a bit overkill to do a promise on css, however, I need this to work everytime without any failure and this is only a temporal bugfix; or at least. That's what I'm assuming as more people in similar situations are having the same results as sought their answer in either CSS or Javascript to fix it.

I've measured the performance before and after the fix, to me, the results were neglactable and not worth mentioning in this post. I still had pages that loaded around a solid 200-400ms so that little snippet didn't worry me in the least.
This post helped me solve a problem today that kept me puzzling for an good half hour. I was fiddling with the newline as I had to get the textarea to recognize the newline. It happends to be, to my unknowledge, that a textarea doesn't automaticly take /r/n into account. Specifcally those two in combination.

The first approved answer happened to be my solve. My journey towards that answer costed me an hour of research into why that is. I was loading my content out of a database with PHP and this dazzled me at first as when I printed the text, it would nicely make a line break. Yet, whenever I entered that very bit of code into a textarea, it didn't.

Another experience richer and more knowledgable. I used preg_replace() to convert "/r/n" into "
". I'll post the actual snippet later in this post.
on Tuesday, 14 January 2014
Today was a wise lesson in Linux. I coudn't configure LAMP, still don't know why. Must be something I am doing wrong though. I've carefully followed multiple guides, checked, double checked, yet coudn't get vhosts to work properly. I've installed XAMPP for Linux as an alternative to LAMP and this seems to do the job.

Then I was challenged by the second failure. I installed chrome. I used chrome for a good few hours, when all of a sudden chrome seemed unrespondsive. The OS itself was fine, just chrome. Then it just crashed and had to do a restart. When rebooted I coudn't login. Followed a guide and everything was fine. Lesson learned, using Firefox now. I already found it strange that chrome had no search result in the software center. Ubuntu itself is a blast to use however. I really found that the overall experience, coming from Windows 7 / 8; that it works smoother. Everything is snappier. I like it. I can see myself using this at home, the steam list is growing and the days of Microsoft are counted for.

Cannot wait to personally make the step! I can use my experience that I have at work to install it on my own machine. On that note, coming from someone who has had a few lessons in how to handle Linux, that it has a pretty hard learning curve. You need technical knowledge when facing a problem and often terminal is key to solving whatever problem your facing. However, I'm willing, patient and backed-up by a great Google+ Community, AskUbuntu and an pretty knowledgable boss that knows it's way around the terminal.

~ Rob