Category: Front-End (Page 2 of 3)

10 Best Free Fonts For Websites

Well! Every now and then we come across to a situation where free font is a question. Which free font is the best? Are they good enough for my website?
So, today am listing down the best 10 free fonts that too from google.

Fonts have been picked after using them from quite some times and also keeping the readability in mind. Sequence starts from the best ones.

Font 1 : Open Sans

Open Sans is a humanist sans serif typeface designed by Steve Matteson, Type Director of Ascender Corp.

Google Fonts Link Here

Font 2 : Roboto

Roboto has a dual nature. It has a mechanical skeleton and the forms are largely geometric. At the same time, the font features friendly and open curves. While some grotesks distort their letterforms to force a rigid rhythm, Roboto doesn’t compromise, allowing letters to be settled into their natural width. This makes for a more natural reading rhythm more commonly found in humanist and serif types. Designed by Christian Robertson

Google Fonts Link Here

Font 3 : Montserrat

The old posters and signs in the traditional Montserrat neighborhood of Buenos Aires inspired Julieta Ulanovsky to design this typeface and rescue the beauty of urban typography that emerged in the first half of the twentieth century.

Google Fonts Like Here

Font 4 : Source Sans Pro

Source® Sans Pro, Adobe’s first open source typeface family, was designed by Paul D. Hunt. It is a sans serif typeface intended to work well in user interfaces.

Google Fonts Link Here

Font 5 : PT Sans

PT Sans is based on Russian sans serif types of the second part of the 20th century, but at the same time has distinctive features of contemporary humanistic designs. Designed by Alexandra Korolkova, Olga Umpeleva and Vladimir Yefimov and released by ParaType in 2009.

Google Fonts Link Here

Font 6 : Lato

Lato is a sans serif typeface family started in the summer of 2010 by Warsaw-based designer Łukasz Dziedzic (“Lato” means “Summer” in Polish). In December 2010 the Lato family was published under the Open Font License by his foundry tyPoland, with support from Google.

Google Fonts Link Here

Font 7 : Oswald

Oswald is a reworking of the classic style historically represented by the ‘Alternate Gothic’ sans serif typefaces. The characters of Oswald were initially re-drawn and reformed to better fit the pixel grid of standard digital screens. Oswald is designed to be used freely across the internet by web browsers on desktop computers, laptops and mobile devices.

Google Fonts Link Here

Font 8 : Pontano Sans

Pontano Sans is a minimalist and light weighted Sans Serif. Pontano is designed mainly for use as a display font but is useable as a text font too. Pontano Sans has been designed to be used freely across the internet by web browsers on desktop computers, laptops and mobile devices.

Google Fonts Link Here

Font 9 : NTR

NTR is a Telugu handwriting font inspired by the artist Bapu who is famous among Telugu people. The Telugu is designed and developed by Purushoth Kumar Guttula in 2013 and made available by Silicon Andhra under the SIL Open Font License v1.1.

Google Fonts Link Here

Font 9 : Quicksand

Quicksand is a display sans serif with rounded terminals. The project was initiated by Andrew Paglinawan in 2008 using geometric shapes as a core foundation. It is designed for display purposes but kept legible enough to use in small sizes as well. In 2016, in collaboration with Andrew, it was thoroughly revised by Thomas Jockin to improve the quality.

Google Fonts Link Here

Content Source for fonts: Google Fonts

TIP: Use google fonts by importing in css to increase page speed.

For more tips and coding standards you can read this.

Happy Coding!

How to write angular services in angular 4 ?

Recently I was working on this angular project when I got stuck to a place – angular services. I wanted to use global variables and functions but had no clue how do i achieve it. After lot of research and going through angular docs i finally ended up to a solution of services.

Angular Services is nothing but an inject-able piece of code that every component can call and use. We will follow the steps to achieve it:

STEP 1

In your command line write:

ng generate service service-name

(service-name will be name of your service) now you will see two files added to your app folder.

STEP 2

Open the file service-name.service.ts and write the following code:
import { Injectable} from '@angular/core';
import { Http, Response, RequestOptions, Headers } from '@angular/http'; // For http calls if any else you can remove this line.

@Injectable()
export class PortfolioService {

headers = new Headers();
options;
api_url = '';
site_url = '';
skin = '';

constructor(private http:Http) {

this.http.get('assets/config.json').subscribe(data => {
this.skin = data.json().skin;
this.renderer.addClass(document.body, this.skin);
});

}

getapiurl(){
this.http.get('assets/config.json').subscribe(data => {
this.api_url = data.json().api_url;
console.log(this.api_url);
});
return this.api_url;
}

getsiteurl(){
this.http.get('assets/config.json').subscribe(data => {
this.site_url = data.json().site_url;
console.log(this.site_url);
});
return this.site_url;
}

}

Here in our example we are fetching the values for api_url , site_url and skin from config.json file using http request.
the function getapiurl() has a return statement in the end which returns the value of the variable api_url

STEP 3

Open your component file and add following code at respective places.

Starting with imports:
import { ServiceNameService } from '../service-name.service';

In your @component add this:
providers: [ServiceNameService]

In your constructor add this to the parameter:
private service: ServiceNameService
Like this
constructor(private service: ServiceNameService )

Now comes the important part of calling the function that we created in the service file.
We have declared a private variable service in our constructor using which we will call our functions.

this.service.getapiurl()

The above code will give the output as the value of the variable we returned in service.
Thats it!
Now you can use the same function as many times we want and in every component we like.
For any queries leave a comment or you can contact me on the given details in the sidebar.

Enjoy! Happy Coding.

Basic Coding Standards

I came across lot of front-end developers asking “What are the basic coding standards for front-end development?” Well, honestly everyone have their own way of writing codes, the way they are comfortable. But, if you ask me we should follow a practice of coding that all the developers understand and also, saves their time.

Few points that I follow are most important while coding:

  1. Code Indentation – The code should be properly indented with tabs and spaces. The hierarchy should be in such a way that by looking it we as a developer easily understand the structure. Also, it avoids missing any tags to close.
  2. Comments  A lot of developers do not comment or else they comment a lot, comment tells yourself and another developer what is your code about and why is it there in the first place. Second a lot of comments increases the file size and which also leads to slow down the website.
  3. Nomenclature – This is a very crucial and one of the most important factor of coding standard, when writing HTMLs we often us classes and now here’s the issue “What should I use for classes? Hyphens(-)? CamelCase?” Again, CamelCase is apt for javascript/jQuery but, for CSS it is recommended to use hyphens because while typing you need not hit shift key again and again for capital letters in between which increase your chances of making mistakes. People say using hyphens increases the size of css well, so does a capital letter so its recommended to avoid hitting special keys and save time. Using names of classes related to div is important. If its a container we better name it as container instead main-container or main-section. Using smaller names increases the speed of coding and reduces the code length.
  4. Project Structure – Well it goes as follows:
    1. Project Name (Folder)
      1. img (Folder)
      2. fonts (Folder)
      3. js (Folder)
      4. css (Folder)
      5. index.html (Files)
  5. Image Sizes – To avoid large images in website few tips, choose .jpg images over png if background transparency isn’t an issue. Saving it with quality of 50% or Medium also helps in reducing the files size. It is recommended that we convert icons to fonts (https://icomoon.io/app/) for fast loading and optimization.
  6.  Minify – Once all the code is tested its a best practice to minify all the css and combine them in one which reduces the server calls. Same applies to javascript/jQuery post development multiple js files can be combined, minified and hosted. If possible we can minify HTMLs too.
  7. Backup – Backup has always been an issue but, its never an issue if we start our projects after creating a repository on git. I usually use https://gitlab.com/ and https://www.sourcetreeapp.com/

 

So, these are points that we all should follow while we code as a front-end developer.

Leave a comment for any queries or requests.

Page 2 of 3

Powered by DisenoBox