I want to use Google's Roboto font on my website and I am following this tutorial:
I have downloaded the file which has a folder structure like this:
Now I have three questions:
The example he uses this
What should my url look like, if I want to have the dir structure like:
/media/fonts/roboto
5,18477 gold badges3535 silver badges5050 bronze badges
user26user26
1,06755 gold badges1313 silver badges2121 bronze badges
9 Answers
You don't really need to do any of this.
The page will give you a
<link> element to include in your pages, and a list of sample font-family rules to use in your CSS.
Using Google's fonts this way guarantees availability, and reduces bandwidth to your own server.
Sunil Garg
4,87988 gold badges5555 silver badges8585 bronze badges
user1864610
There are TWO approaches that you can take to use licensed web-fonts on your pages:
Long story short:
Using font hosting services along with @font-face declaration gives best output with respect to overall performance, compatibility and availability.
Source: https://www.artzstudio.com/2012/02/web-font-performance-weighing-fontface-options-and-alternatives/
UPDATE
Roboto: Google’s signature font is now open source
You can now manually generate the Roboto fonts using instructions that can be found here.
Dave Powers
73211 gold badge1212 silver badges2121 bronze badges
Ashesh Kumar SinghAshesh Kumar Singh
2,72411 gold badge1919 silver badges3636 bronze badges
Old post, I know.
This is also possible using CSS rocksteadyrocksteady
@import url :
1,15022 gold badges1515 silver badges2929 bronze badges
The
src refers directly to the font files, therefore if you place all of them on /media/fonts/roboto you should refer to them in your main.css like this:src: url('./fonts/roboto/Roboto-ThinItalic-webfont.eot');
The
. goes one folder up, which means you're referring to the media folder if the main.css is in the /media/css folder.
You have to use
./fonts/roboto/ in all url references in the CSS (and be sure that the files are in this folder and not in subdirectories, such as roboto_black_macroman ).
Basically (answering to your questions):
I have css in my media/css/main.css url. So where do i need to put that folder
You can leave it there, but be sure to use
src: url('./fonts/roboto/
![]()
Do i need to extract all eot,svg etc from all sub folder and put in fonts folder
If you want to refer to those files directly (without placing the subdirectories in your CSS code), then yes.
Do i need to create css file fonts.css and include in my base template file
Not necessarily, you can just include that code in your main.css. But it's a good practice to separate fonts from your customized CSS.
Here's an example of a fonts LESS/CSS file I use:
(In this example I'm only using the ttf)Then I use ArmfootArmfoot
@import 'fonts'; in my main.less file (less is a CSS preprocessor, it makes things like this a little bit easier)
3,36411 gold badge3131 silver badges5555 bronze badges
Use /fonts/ or /font/ before font type name in your CSS stylesheet. I face this error but after that its working fine.
Mohammed JavedMohammed Javed
59911 gold badge77 silver badges1919 bronze badges
Mr. NobodyMr. Nobody
Did you read the How_To_Use_Webfonts.html that's in that zip file?
After reading that, it seems that each font subfolder has an already created .css in there that you can use by including this:
Barry Colebank JrBarry Colebank Jr
1,56622 gold badges1313 silver badges1616 bronze badges
it's easy
every folder of those you downloaded has a different kind of roboto font, means they are different fonts
example: 'roboto_regular_macroman'
to use any of them:
1- extract the folder of the font you want to use
2- upload it near the css file
3- now include it in the css file
example for including the font which called 'roboto_regular_macroman':
watch for the path of the files, here i uploaded the folder called 'roboto_regular_macroman' in the same folder where the css is
then you can now simply use the font by typing
font-family: 'Roboto';
Omar MoustafaOmar Moustafa
Lead DeveloperLead Developer
Not the answer you're looking for? Browse other questions tagged htmlcssfonts or ask your own question.
Posted by2 years ago
Archived
I have two troublesome fonts I'm trying to delete to fully uninstall Razer Synapse (even if the fonts don't matter, I'm being stubborn at this point) but, despite not even being installed and having full ownership and permission to do so, they won't budge because they're apparently open in System. I've tried looking for them everywhere and they're only in the Synapse -> Fonts folder and nowhere else to my knowledge.
I have nothing Razer related running. I've tried messing with admin permissions, tried process explorer, etc. I was able to use the cmd prompt to 'delete' one of the two, but it still appears in the folder and gives me the same error. I'm lost.
4 comments
Archived from groups: microsoft.public.windowsxp.configuration_manage (More info?)
Hello, newsgroup! I am using WindowsXP Pro in a Windows server domain. Always when I try to re-organize my folders the following very annoying behavior occurs: I try to delete or move a folder. Windows XP refuses to do so because the folder is still used by another process. Maybe this is because I clicked at the folder before, but there are definitely no programs open, which currently use this folder. Of course I can use shareware tools to identify the process and the particular handle and abort it. But when I do this every other time I need to delete or move a folder, this is VERY annoying. Is there no other way? Greetings Marc
Starting with Windows 7 and continuing to Windows 10, the process for managing fonts in Windows has become much more streamlined and easier to use. Whether you are a professional who needs to install lots of fonts for your work or someone who wants to speed up their computer by getting rid of useless fonts, Windows makes it easy to perform either task.
If you do run into any trouble along the way, such as when trying to delete a font, I’ve also posted alternate methods to help troubleshoot the problem. Note that the procedures below can be accomplished in Windows 7, Windows 8.1 or Windows 10. If there is anything operating specific, I will mention that separately.
How to Install a Font
Once you have downloaded your font file, go ahead and open the folder where your font is saved. Now double-click on the font file.
A window will appear where you will get to see a preview of all the numbers and letters for that font. It will also show you a sample sentence in different font sizes. To install the font on your system, click the Install button at the top.
That’s it! Your font is now installed! If you open a program like Word, you’ll see it should now be there in the list of fonts. You can select it and start typing with the new font.
How to Delete a Font
Deleting a font is almost just as easy. First, open Control Panel and click on the Fonts folder. If you’re in Category view, go ahead and switch to Icon view.
Select the font you want to delete and then click the Delete button towards the top of the window.
If all goes well, your font should be removed from your system. Now there are a few situations where you might run into problems. Firstly, you might get a message stating that the font cannot be deleted because it is in use.
If you run into this problem, you should first close all programs and try again. If that doesn’t work, try restarting your computer and then deleting the font. As a last resort, you can restart in Safe Mode and then try to delete it.
Another way to delete the font is via the Windows registry. Before you edit anything, make sure to backup the registry. Now click on Start and type in regedit. Navigate to the following registry key:
Find the font in the list on the right, then right-click and choose Delete. You will be able to delete the font file even if you were getting the in-use message earlier. Note that if you have 64-bit Windows installed, you also need to go to this registry key and delete the font from here too:
After you have deleted the key from both locations, go ahead and restart the computer for the changes to take effect. The font should now be gone from all programs.
This method can also be used to delete fonts that are protected system fonts. For example, let’s say you wanted to delete Times New Roman. If you tried via the Control Panel, you’ll get an error message.
You can, however, go into the registry and get rid of the font there. Make sure to restart your computer after deleting the entries from the registry. There really isn’t any good reason to delete protected system fonts, so I wouldn’t recommend it.
If you already have installed a bunch of fonts on your computer and now don’t want to have some many extra fonts installed, you can check out my previous post on how to restore the default Windows fonts.
Finally, you can also create your own font and then install it using this guide! If you have any questions, feel free to comment. Enjoy!
I am trying to delete a directory recursively with
rm -Force -Recurse somedirectory , I get several 'The directory is not empty' errors. If I retry the same command, it succeeds.
Example:
Of course, this doesn't happen always. Also, it doesn't happen only with
_svn directories, and I don't have a TortoiseSVN cache or anything like that so nothing is blocking the directory.
Any ideas?
Peter Mortensen
2,16644 gold badges2222 silver badges2424 bronze badges
Mauricio SchefferMauricio Scheffer
43622 gold badges88 silver badges2323 bronze badges
9 Answershelp Remove-Item says:
The Recurse parameter in this cmdlet does not work properly.
and
Because the Recurse parameter in this cmdlet is faulty, the command uses the Get-Childitem cmdlet to get the desire d files, and it uses the pipeline operator to pass them to the Remove-Item cmdlet.
and proposes this alternative as an example:
So you should pipe Dennis WilliamsonDennis Williamson
get-childitem -recurse into remove-item .
51.5k1111 gold badges9393 silver badges132132 bronze badges
@JamesCW: The problem still exists in PowerShell 4.0
I tried another workaround and it worked: use cmd.exe:
Mehrdad MirrezaMehrdad Mirreza
ETA 20181217: PSVersion 4.0 and later will still fail in some circumstances, see alternate answer by Mehrdad Mirreza, and bug report filed by mklement
mklement provides a Proof of Concept solution at this SO answer, as the bug is awaiting an official fix
Font Cannot Be Deleted Because It Is In Use Crossword
The new version of
PowerShell (PSVersion 4.0 ) has resolved this issue entirely and Remove-Item 'targetdirectory' -Recurse -Force works without any timing problems.
You can check your version by running JamesCWJamesCW
$PSVersiontable from within the ISE or PowerShell prompt. 4.0 is the version that ships with Windows 8.1 and Server 2012 R2 , and it can be installed on previous versions of Windows as well.
28411 gold badge44 silver badges1616 bronze badges
The current answer won't actually delete a directory, just its children. Furthermore it will have problems with nested directories as it will again be trying to delete a directory before its contents. I wrote something to delete the files in the correct order, would still have the same problem though sometimes the directory would still be around afterward.
So, now I use something that will catch the exception, wait, and retry (3 times):
For now I'm using this:
fschwietfschwiet
To delete the directory and its contents takes two steps. First delete the contents, then the folder itself. Using the workaround for the faulty recursive remove item the solution would look like this:
This way you can remove the parent directory as well.
Carl BakerCarl Baker
Gosh. Lots of answers. I honestly prefer this one over all of them. It's super simple, complete, readable, and works on any Windows machine. It uses .NET's (reliable) recursive delete functionality and if it fails for some reason, it throws a proper exception that can be handled with a try/catch block.
Note that the PhilPhil
Resolve-Path line is important because .NET is not aware of your current directory when resolving relative file paths. That's about the only gotcha I can think of.
52822 gold badges88 silver badges1414 bronze badges
This is what I have working:
This first line deletes all files in the tree. The second deletes all the folders including the top.
jscott
22.1k66 gold badges6161 silver badges9090 bronze badges
James CopelandJames Copeland
The existing answers mitigate the problem, so that it occurs less frequently, but they don't address the root cause, which is why failures can still occur. Windows 10 iot iso raspberry downloads.
Remove-Item -Recurse is unexpectedly asynchronous, ultimately because the Windows API methods for file and directory removal are inherently asynchronous and Remove-Item doesn't account for that.
Font Cannot Be Deleted Because It Is In Use Today
This intermittently, unpredictably manifests in one of two ways:
The problem not only affects PowerShell's
Remove-Item , but also cmd.exe 's rd /s as well as .NET's [System.IO.Directory]::Delete() :
As of Windows PowerShell v5.1 / PowerShell Core 6.2.0-preview.1 /
cmd.exe 10.0.17134.407 / .NET Framework 4.7.03056, .NET Core 2.1, neither Remove-Item , nor rd /s , nor [System.IO.Directory]::Delete() work reliably, because they fail to account for the asynchronous behavior of the Windows API file/directory-removal functions:
For a custom PowerShell function that provides a reliably synchronous workaround, see this SO answer.
mklementmklement
Take ownership of the files / directories first using Takeown.exe then delete
AveryFreemanAveryFreeman
Not the answer you're looking for? Browse other questions tagged powershell or ask your own question.Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |