Error on line 55, column 4 of pubspec.yaml: Expected a key while parsing a block mapping. fonts: - flutter-dependencies

Error on line 55, column 4 of pubspec.yaml: Expected a key while parsing a block mapping.
fonts:

fonts:
- family: Heebo
fonts:
- asset: fonts/Heebo-Regular.ttf
- asset: fonts/Heebo-Bold.ttf
weight: 700
- asset: fonts/Heebo-Black.ttf
weight: 400
there is requre two spaces in between fonts and family

1.In Android Studio, you need to create a package under lib folder. For example you create a package fonts (path is app_name/lib/fonts).
2.In the pubspec.yaml the code would look like:
flutter:
fonts:
- family: Oxygen
fonts:
- asset: app_widgets/lib/fonts/Oxygen-Regular.ttf
- asset: app_widgets/lib/fonts/Oxygen-Bold.ttf
weight: 700
- asset: app_widgets/lib/fonts/Oxygen-Light.ttf
weight: 300

Related

React Native - Failed to parse declaration in styled-components

The same approach using stylesheet works normally
Environment
System:
OS: macOS 11.6
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU # 2.60GHz
Memory: 1.03 GB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 16.6.0 - ~/.nvm/versions/node/v16.6.0/bin/node
Yarn: 1.22.11 - ~/.nvm/versions/node/v16.6.0/bin/yarn
npm: 6.14.4 - ~/Projects/design-system/typography/node_modules/.bin/npm
Watchman: 2021.09.13.00 - /usr/local/bin/watchman
npmPackages:
styled-components: 5.1.0 => 5.1.0
Reproduction
import React from 'react';
import styled from 'styled-components/native';
import { View } from 'react-native';
const CustomText = styled.Text(({ theme }) => ({
fontFamily: 'Zapf Humanist 601',
}));
export default App = () => (
<View>
<CustomText>Your Text<CustomText>
</View>
);
Steps to reproduce
Copy ZapfHumanist601BT-Roman.ttf in your fonts folder (./src/assets/fonts)
Make a link font using npx react-native link
Apply a linked font in your text component
Expected Behavior
The font is expected to be applied in the style
Actual Behavior
Error: Failed to parse declaration "fontFamily: Zapf Humanist 601"
The font-weight property will not work fine in this situation.
You can put your fonts in src/assets/fonts directory:
src
|_ assets
|_ Montserrat-Bold.ttf
|_ Montserrat-Regular.ttf
// and so on for the rest of fonts file
And define the assets properties in the react-native.config.js file which is at the root of your project in this way:
module.exports = {
project: {
ios: {},
android: {},
},
assets: ['./src/assets/fonts/'],
};
Now, you can use the fonts in the styles like this (without define the weight property):
title : {
fontFamily: Montserrat-Regular
}

React-native fontFamily is not working as it should

I am trying to use the custom font called times-news-roman.
I created react-native.config.js file, here is what's inside of it
module.exports = {
project: {
ios: {},
android: {}, // grouped into "project"
},
assets: ['./assets/fonts/'], // stays the same
};
I also created my assets folder in the root of the app.
I am trying to use this custom font like this:
headerTextLight: {
color: 'black',
fontWeight: 'bold',
fontSize: 30,
paddingLeft: 10,
paddingTop: 10,
fontFamily: 'times-new-roman',
},
But I am getting this error:
Unrecognized font family 'times-new-roman'
I am using "react-native": "^0.63.3". Any suggestions please?
Check that your fonts are included in your bundled resources within the Build Phases section
Add your fonts to the Info.plist
Within your project folder navigate to the Info.plist file where you will want to add your fonts. Hover on the last line in the list and click on the plus sign to add a new line. Select the option “Fonts provided by application.” Now you will add all your fonts and make sure the string is EXACTLY THE SAME as the font file (.otf, .ttf) name.

"Source image not resolvable" Liip

With a ezPlatform 2.5 project (based on Symfony 3.4) i need to import and convert some images. I'm using version 2.2.0 of LiipImagineBundle
I store my images in directories : "web/images/typeA/", "web/images/typeB/" etc...
Here's my configuration :
liip_imagine:
resolvers:
default:
web_path:
web_root: "%kernel.project_dir%/web"
cache_prefix: "media/cache"
loaders:
default:
filesystem:
data_root: "%kernel.root_dir%/../web"
# - "%kernel.project_dir%/web"
# - "%kernel.project_dir%/web/images"
driver: gd
data_loader: default
cache: default
filter_sets:
# list of filters...
Directories "web/images" and subfolders are created by a symfony command (sources files are imported from NFS). So, if they aren't created yet, i've have the error :
In FileSystemLocator.php line 52:
Source image not resolvable "/path/to/project/www/web/images/typeA/image.jpg" in
root path(s) "/path/to/project/www/web"
I had the error, and I solved it by setting the following in config/packages/liip_image.yaml:
liip_imagine :
resolvers :
default :
web_path : ~
loaders:
default:
filesystem:
data_root: "/" # <-- This setting
thank you for your answer. I've fixed it like this :
liip_imagine:
driver: "%liip_imagine_driver%"
resolvers:
default:
web_path:
web_root: "%kernel.project_dir%/web"
cache_prefix: assets/media/cache
loaders:
default:
filesystem:
data_root:
- "%kernel.root_dir%/../web"

Problem when rendering Open-sans font in React Native V 60+

i want to add 'Open-sans' font to my App but i have an issue and it happens on IOS simulator only
here is my steps :
a) I've created a folder in root app as : assets then fonts fonts folder in assets and put Open-sans.ttf
b) I've made a file in root with the name react-native-config.js and add:
module.exports = {
project: {
ios: {},
android: {},
},
assets: ['./assets/fonts/'],
};
c) react-native link
d) In the App.js
<Text style={{fontFamily: 'OpenSans-Bold', fontWeight: 'bold'}}>
This is my first App
</Text>
My problem is it keeps telling me `Unrecognized font family' whenever i made any edit in the App.js
but when i open react-native-config.js and do nothing but save only the hot reload fired and the font is working
as i mentioned it's perfect on Android but the error appears on IOS when save after any edit on App.js file
For IOS the font-family value is fullname and for android its file name.
Try:
<Text style={{fontFamily: 'Open Sans Bold'}}>This is my first App</Text>
For Android, change the file name 'OpenSans-Bold.ttf' to 'Open Sans Bold.ttf'
I was with the same error, so thats what I did:
1 - Rename react-native-config.js to react-native.config.js and put this script on file:
module.exports = {
assets: ['./src/assets/fonts'], // this is my path
};
2 - put it on my package.json :
rnpm": {
"ios": {},
"android": {},
"assets": [
"./src/assets/font"// this is my path
]
},
and After I run react-native link && yarn react-native link.
Check if your info-plist and your android assets are changed
As per your description you have only put Open-sans.ttf in asset folder. But you are trying to access OpenSans-Bold which is not added to your asset folder. To get access to any particular font, you need to add that one to the asset folder. Here is an example for your referrence...
you can check this too for better understanding

duckling module for rasa

I try to train my bot based on rasa_nlu.
Below is my config file and i have problems because entity like "next month" is recognized by ner_spacy to be something else than time data. I want this type of entity to be recognized only by duckling module.
Thanks
language: "en"
project: "nav-os"
pipeline:
- name: "nlp_spacy"
model: "en"
- name: "ner_spacy"
- name: "tokenizer_spacy"
- name: "intent_entity_featurizer_regex"
- name: "intent_featurizer_spacy"
- name: "ner_crf"
- name: "ner_synonyms"
- name: "intent_classifier_sklearn"
- name: "ner_duckling"
dimensions:
- "time"
You could exclude the dimension for spaCy by defining the ones you want to include like it is described in the documentation.
Means you could configure the spacy_ner component like the following to only extract PERSON entities (just as example).
pipeline:
- name: "SpacyEntityExtractor"
# dimensions to extract
dimensions: ["PERSON"]